#include<stdio.h>
#include<conio.h>
int main()
{
int i, j, n, m, s = 0;
while(1)
{
printf("Enter Any Number : ");
scanf("%d", &n);
m = n;
i = n%10;
s = 0;
while(n != 0)
{
j = n%10;
s = s + j;
n = n/10;
}
if(i%2 == 0 && s%3 == 0)
{
printf("\n%d is divisible by 6\n\n", m);
}
else
{
printf("\n%d is not divisible by 6\n\n", m);
}
getch();
}
return 0;
}
#include<conio.h>
int main()
{
int i, j, n, m, s = 0;
while(1)
{
printf("Enter Any Number : ");
scanf("%d", &n);
m = n;
i = n%10;
s = 0;
while(n != 0)
{
j = n%10;
s = s + j;
n = n/10;
}
if(i%2 == 0 && s%3 == 0)
{
printf("\n%d is divisible by 6\n\n", m);
}
else
{
printf("\n%d is not divisible by 6\n\n", m);
}
getch();
}
return 0;
}
Comments
Post a Comment