Computer Science, asked by limpi6140, 1 year ago

Divisible by 2 or 3 write a program that prints yes if the given integer is divisible by 2 or 3 and no otherwise. Input format: input consists of a single integer. Output format: output consists of a single line. Refer sample output for the format. Sample input 1 : 21 sample output 1 : yes sample input 2: 19 sample output 2: no

Answers

Answered by tanothelol
0

Answer: here u go!!!

Explanation:

Input Format:

Input consists of a single integer.

Output Format:

Output consists of a single line. Refer sample output for the format.

Sample Input 1 :

21

Sample Output 1 :

yes

Sample Input 2:

19

Sample Output 2:

no

Code:

 #include<stdio.h>

int main(){

 int a;

 scanf("%d",&a);

 if((a%2==0)||(a%3==0))

 printf("yes");

 else

 printf("no");

 return 0;

}

Similar questions