Function Programming : divisible by 9 in C

Write a program to check Number which is dividable by 9 or not. Use function to call and return the value.
 
Source Code in C:
#include <stdio.h>
void check_divisible(int);
int main( )
{
     int n, result;
     printf("\n Enter the number to check");
     scanf("%d", &n);
     result=check_divisible(n);
     return 0;
}

void check_divisible(int a)
{
     int i=9;
     if (a%9 = =0)
          printf("\n This is divisible by 9");
     else
          printf("\n This is not divisible by 9");
}

36 comments:

  1. #include
    #include

    int check_divisable(int a);
    int main()
    {
    int p,result;
    printf("\n Enter number for check if it is divisable or not by 9: ");
    scanf("%d",&p);
    result=check_divisable(p);
    getch();
    return 0;

    }

    int check_divisable(cse)
    {
    int i=9;
    if(cse%i==0)
    printf("\n It is divisable by 9");
    else
    printf("\n It is not divisable by 9");
    getch();
    return i;
    }

    ReplyDelete
  2. #include
    #include
    int check_divisable(int);
    int main()
    {
    int n,result;
    printf("\n Enter number for check if it is divisable by 9 or not");
    scanf("%d",&n);
    result=check_divisable(n);
    getch();
    return 0;


    }

    int check_divisable(int a)
    {
    int i;
    i=9;
    if(a%9==0)
    printf("\n This is divisable by 9");
    else
    printf("\n This is not divisable by 9");
    return i;

    }

    ReplyDelete
  3. #include
    main()
    {
    int a,b=9;
    printf("Enter your number : ");
    scanf("%d",&a);
    check(a,b);
    }

    int check(int a,int b)
    {
    if (a%b==0)
    printf("\nThe number is divisable by 9\n\n");
    else
    printf("\nThe number is not divisable by 9\n\n");
    return 1;
    }

    ReplyDelete
  4. #include
    void Check(int i);
    main() {
    int number;
    printf(" \n Enter a number to check : ");
    scanf("%d",&number);
    Check(number);
    }
    void Check(int i) {
    if(i%9==0)
    printf(" \n Divisable. ");
    else
    printf(" \n Not Divisable. ");
    }

    ReplyDelete
  5. #include

    int checkDividable(int n)
    {
    int i=9;
    if(n%9==0)
    {
    printf("\nThe number `%d%` is dividable by 9",n);
    }
    else
    {
    printf("\nThe number `%d%` is not dividable by 9",n);
    }
    return i;
    }

    int main()
    {
    int n,result;
    printf("Enter number to check if it is dividable by 9 or not = ");
    scanf("%d",&n);
    result=checkDividable(n);
    return 0;
    }

    ReplyDelete
  6. #include
    using namespace std;
    int check_Divisible()
    {
    int m,n=9;
    cin>>m;
    return(m%n);
    }
    int main()
    {
    if(check_Divisible()==0)
    cout<<"the number is Divisible";
    else
    cout<<"the number is not Divisible";
    }

    ReplyDelete
  7. Md Bashir Fardoush
    ID: 201430385
    Betch: 47th
    /* wap a c program to check number which number is divisible by 9 or not. */

    #include
    using namespace std;

    int divv(int n); /* prototype */

    main(){ /* main body numb is variable for input*/
    int numb,divisedf;
    cout<<"Enter number: " ;
    cin>>numb;
    divisedf=divv(numb);
    if(divisedf==0) cout<<" Dvisible by 9"<<endl;
    else cout<<endl<<"Not divisible by 9"<<endl;

    }
    int divv(int n){ /* function dafinition*/
    int t=1;
    if(n%9==0) t=0;

    ReplyDelete
  8. #include
    using namespace std;
    void divisable (int a,int b)
    {
    if(a%b==0)
    cout<<"dibisable"<>x;
    divisable(x,y);
    }

    ReplyDelete
  9. Id-201210803

    #include
    using namespace std;

    int numcheck(int a)
    {
    if(a%9==0)
    cout<<"\n\nThe number is divisible by 9\n\n";
    else
    cout<<"\n\nThe number is not divisibel by 9 \n\n";
    }
    int main()
    {
    int num;
    cout<<"Enter the number:";
    cin>>num;
    numcheck(num);
    }

    ReplyDelete
  10. #include
    using namespace std;

    class divisible_by_9
    {
    public:
    int number1,number2;
    divisible_by_9();
    void show();
    ~divisible_by_9();
    };

    divisible_by_9::divisible_by_9()
    {
    cout<<"Enter two numbers as two range: ";
    cin>>number1>>number2;
    }
    void divisible_by_9::show()
    {
    int i;
    for(i=number1;i<=number2;i++){
    if(i%9==0)
    cout<<endl<<i<<" is divisible by 9.";
    else
    cout<<i<<" is not divisible by 9.";
    }
    }
    divisible_by_9::~divisible_by_9()
    {
    cout<<endl<<"DESTRUCTING";
    }
    main()
    {
    divisible_by_9 ob1,ob2;
    ob1.show();
    ob2.show();
    }

    ReplyDelete
  11. #include
    using namespace std;
    class number
    {
    public:
    int n,i;
    number();
    void output();
    ~number();
    };
    number::number()
    {
    cout<<"Enter the range: "<>n;
    cout<<endl;
    }
    void number::output()
    {
    cout<<"The divisible numbers are: "<<endl;
    for(i=9; i<=n; i++)
    {
    if(i%9==0)
    cout<<i<<endl;
    }
    }
    number::~number()
    {

    }
    int main()
    {
    number obj;
    obj.output();
    return 0;
    }

    ReplyDelete
  12. #include
    using namespace std;
    class check
    {
    public:
    int num;
    check();
    ~check();
    void show();
    void result();
    };
    check::check()
    {
    cout<<"Enter a number to check:";
    cin>>num;
    }
    check::~check()
    {

    }
    void check::show()
    {
    //int num;
    if(num%9==0)
    cout<<"Divisable";
    else
    cout<<"Not Divisable ";
    }
    void check::result()
    {
    cout<<endl<<"number is:"<<" "<<num<<endl;
    }
    int main()
    {
    check ob;
    ob.show();
    ob.result();
    }


    ID=201510280
    48TH

    ReplyDelete
  13. #include
    using namespace std;

    class cons
    {
    public:
    int number;
    cons(int num);
    ~cons();
    void result();
    };

    cons::cons(int num)
    {
    number = num;
    }

    void cons::result()
    {
    if (number == 0)
    cout << "Enter right number --\n";
    else if (number % 9 == 0)
    cout << number << " Is dividable by 9 --\n";
    else
    cout <> i;
    cons obj(i);
    obj.result();
    return 0;
    }
    id-201510505
    batch 48

    ReplyDelete
  14. #include
    using namespace std;
    class check
    {
    public:
    int num;
    check();
    ~check();
    void show();
    void result();
    };
    check::check()
    {
    cout<<"Enter a number to check:";
    cin>>num;
    }
    check::~check()
    {

    }
    void check::show()
    {
    //int num;
    if(num%9==0)
    cout<<" Divisable";
    else
    cout<<" Not Divisable";
    }
    void check::result()
    {
    cout<<endl<<"number is:"<< " " << num<<endl;
    }
    int main()
    {
    check ob;
    ob.show();
    ob.result();
    }




    Id: 201510992
    48th batch

    ReplyDelete
  15. #include
    using namespace std;
    class number
    {
    public:
    int n;
    number();
    void output();
    ~number();
    };
    number::number()
    {
    cout<<"Enter the number: ";
    cin>>n;
    cout<
    using namespace std;
    class number
    {
    public:
    int n;
    number();
    void output();
    ~number();
    };
    number::number()
    {
    cout<<"Enter the number: ";
    cin>>n;
    cout<<endl;
    }
    void number::output()
    {
    if(n%5==0)
    cout<<"DIVISIBLE..."<<endl;
    else
    cout<<"NOT DIVISIBLE..."<<endl;

    }
    number::~number()
    {

    }
    int main()
    {
    number obj;
    obj.output();
    return 0;
    }


    ReplyDelete
  16. #include
    using namespace std;

    class cons
    {
    public:
    int number;
    cons(int num);
    ~cons();
    void result();
    };

    cons::cons(int num)
    {
    number = num;
    }

    void cons::result()
    {
    if (number == 0)
    cout << "Enter right number --\n";
    else if (number % 9 == 0)
    cout << number << " Is dividable by 9 --\n";
    else
    cout <> i;
    cons obj(i);
    obj.result();
    return 0;
    }

    id:201510386

    ReplyDelete
  17. #include
    using namespace std;
    class number
    {
    public:
    int n,i;
    number();
    void output();
    ~number();
    };
    number::number()
    {
    cout<<"Enter the range: "<>n;
    cout<<endl;
    }
    void number::output()
    {
    cout<<"The divisible numbers are: "<<endl;
    for(i=9; i<=n; i++)
    {
    if(i%9==0)
    cout<<i<<endl;
    }
    }
    number::~number()
    {

    }
    int main()
    {
    number obj;
    obj.output();
    return 0;
    }

    ReplyDelete
  18. #include
    using namespace std;
    class fin
    {
    public:
    int n;
    fin(int n);
    ~fin()
    {
    //cout<<"hghf";
    }
    };
    fin::fin(int n)
    {
    for(int i=1;i<=n;i++)
    if(i%9==0)
    cout<>n;
    fin appel(n);
    }

    ReplyDelete
  19. using C++

    #include
    using namespace std;

    class cons
    {
    public:
    int number;
    cons(int num);
    ~cons();
    void result();
    };

    cons::cons(int num)
    {
    number = num;
    }

    void cons::result()
    {
    if (number == 0)
    cout << "Enter right number --\n";
    else if (number % 9 == 0)
    cout << number << " Is dividable by 9 --\n";
    else
    cout <> i;
    cons obj(i);
    obj.result();
    return 0;
    }

    ReplyDelete
  20. using C++
    constructor
    mamun ur rashid
    #include
    using namespace std;
    class divisible
    {
    public:
    int a;
    divisible();

    ~divisible();
    void result();
    };
    divisible::divisible()
    {
    cout<<"Enter a number :" ;
    cin>>a;
    }
    divisible::~divisible()
    {

    }
    void divisible::result()
    {
    if(a%9==0)
    cout<<"This is divisible :"<<"\n";
    else
    cout<<"This is not divisible :";
    }
    int main()
    {
    divisible sb;
    sb.result();
    }

    ReplyDelete
  21. #include
    using namespace std;

    class Divisible
    {
    public:
    int num;
    Divisible();

    ~Divisible()
    {
    cout<<"Distructor active";
    }
    int func()
    {
    if(num%9==0)
    cout<<"The number is divisible"<>num;
    }

    int main()
    {
    Divisible obj;
    obj.func();
    return 0;
    }

    id:201510660

    ReplyDelete
  22. #include
    using namespace std;

    class Divisible
    {
    public:
    int a;
    Divisible();

    ~Divisible()
    {
    cout<<"Distructor active";
    }
    int setu()
    {
    if(a%9==0)
    cout<<"The number is divisible"<>num;
    }

    int main()
    {
    Divisible obj;
    obj.setu();
    return 0;
    }
    id:201510992

    ReplyDelete
  23. using c++

    #include
    using namespace std;

    class cons
    {
    public:
    int number;
    cons(int num);
    ~cons();
    void result();
    };

    cons::cons(int num)
    {
    number = num;
    }

    void cons::result()
    {
    if (number == 0)
    cout << "Enter right number --\n";
    else if (number % 9 == 0)
    cout << number << " Is dividable by 9 --\n";
    else
    cout <> i;
    cons obj(i);
    obj.result();
    return 0;
    }

    ReplyDelete
  24. ID : 201620195
    https://www.dropbox.com/s/6kzvk0ojupv0f6h/02.cpp?dl=0

    ReplyDelete
  25. ID:201520552
    1)https://drive.google.com/open?id=0B5pG0kIjzgEKRVlfOERKSV9UYWc
    2)https://drive.google.com/open?id=0B5pG0kIjzgEKVjFZSm5QWXA4T2c

    ReplyDelete
  26. MD USUF MIA
    ID 201610456
    solved following inhertance,method,constructor,etc
    link:
    https://drive.google.com/open?id=0B_PIGnOMR0K2R19OZW1sNWFuNUU

    ReplyDelete
  27. Summer 2017
    ID#201610042

    https://drive.google.com/file/d/0B99eePh0LV8gQ0lJNlJlYllweW8/view?usp=drivesdk

    ReplyDelete
  28. Name:Abdullah
    ID:201710933
    https://drive.google.com/open?id=0B0bbxKUPFizZemhvT29Fa1dJdzQ

    ReplyDelete
  29. https://drive.google.com/open?id=0Byxq3aat_mNSbnViUEdOVkQxWHM

    ReplyDelete
  30. https://drive.google.com/open?id=0B3bVD5Ppt_STeXQySkUzOXFmanc

    ReplyDelete
  31. https://drive.google.com/open?id=0BzKpnVbF4fc3QlFwdXNVTTZEZFk

    ReplyDelete
  32. ID:201710494
    https://www.dropbox.com/s/ax1vvq8jrxkhzrk/Hw2%282%29.cpp?dl=0

    ReplyDelete
  33. https://drive.google.com/open?id=0B5eevQy6QwSObEhybVVHSmEyRnc

    ReplyDelete
  34. ID:-201610058
    1.https://drive.google.com/open?id=0B7UQyRdu6h2wUXVKakJZekVBcjg

    ReplyDelete
  35. ID #201610288
    Section A
    Summer 2017
    https://drive.google.com/open?id=1585JYqnqHP6VC5RQPKqES1XwEZ_8TKpP-0nZGKm1IUg

    ReplyDelete
  36. #include
    using namespace std;

    class div
    {
    public:
    int n;
    div()
    {
    cout<<"Enter the number to check:";
    cin>>n;
    }
    void result()
    {
    if(n%9==0)
    cout<<"This is divisible by 9";
    else
    cout<<"This is not divisible by 9";
    }
    };
    int main()
    {
    div obj;
    obj.result();
    return 0;
    }

    ReplyDelete