Wap to check whether the number is divisible by 7 or not ,if yes then further check whether it is divisible by 4 or not
#include<iostream.h>
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int n;
cout<<"enter number";
cin>>n;
if(n%7==0)
{
if(n%4==0)
cout<<"divisible by both";
else
cout<<"divisible by 7 but not by 4";
}
getch();
}
****************
OUTPUT:
enter number 364
divisible by both
****************
No comments:
Post a Comment