Code to check number divisible by 3 and 5

Code to check number is divisible by 3 and 5

(If number is divisible by both 3&5 then it will print Hi, otherwise it will print bye)


#include<stdio.h>
#include<conio.h>
void main()
{
int a;
printf("Enter any number");
scanf("%d",&a);
if((a%3==0)&&(a%5==0))
{
printf("Hi");
}
else
{
printf("Bye");
}
getch();
}

Output



Comments

Popular posts from this blog

Code for pattern 6

Code to check leap year