Saturday, 15 October 2016

HHW Q15. WAP to enter the no. and check its visibility by nos.

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
long int a,b,c;
cout<<"Enter the no. (divisor) ";
cin>>a;
cout<<"Enter the no. (dividend) ";
cin>>b;
c=a%b;
if (c==0)
{ cout<<a<<" is perfectly divisible by "<<b;
}
else
{ cout<<a<<" is not divisible by "<<b;
}
getch();
}

No comments:

Post a Comment

Basic Implementation of Array as a Pointer

#include<iostream.h> #include<conio.h> void main() { clrscr();   int arr[5];   cout<<"Enter 5 nos. ";   f...