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");
}
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");
}
#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;
}
#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;
}
#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;
}
#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. ");
}
#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;
}
#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";
}
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;
#include
উত্তরমুছুনusing namespace std;
void divisable (int a,int b)
{
if(a%b==0)
cout<<"dibisable"<>x;
divisable(x,y);
}
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);
}
#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();
}
#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;
}
#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
#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
#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
#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;
}
#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
#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;
}
#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);
}
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;
}
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();
}
#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
#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
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;
}
ID : 201620195
উত্তরমুছুনhttps://www.dropbox.com/s/6kzvk0ojupv0f6h/02.cpp?dl=0
ID:201520552
উত্তরমুছুন1)https://drive.google.com/open?id=0B5pG0kIjzgEKRVlfOERKSV9UYWc
2)https://drive.google.com/open?id=0B5pG0kIjzgEKVjFZSm5QWXA4T2c