### 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");
}

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;
}

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;

}

3. #include
main()
{
int a,b=9;
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;
}

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. ");
}

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;
}

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";
}

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;

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

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);
}

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();
}

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;
}

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

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

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

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;
}

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

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;
}

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);
}

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;
}

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();
}

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

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

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;
}

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

25. ID:201520552

26. MD USUF MIA
ID 201610456
solved following inhertance,method,constructor,etc

27. Summer 2017
ID#201610042

28. Name:Abdullah
ID:201710933

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

34. ID:-201610058

35. ID #201610288
Section A
Summer 2017

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;
}