Search This Blog

July 10, 2014

Write a Program to check whether a Number is exactly divisible by 3 but not by 5

#include <stdio.h>
#include <conio.h>
int main( )
{
int x;
printf("Enter a number");
scanf("%d",&x);

if(x%3==0 && x%5!=0)
{
printf("%d is exactly divisible by 3 but not by 5",x);



}
else
{
printf("%d is not exactly divisible by 3 but can divisible by 5",x);

}
   

getch ( );
return 0;
}

No comments:

Post a Comment

Earn Money From Home