Computer Science, asked by nilaykundu89, 7 months ago

Write a menu-driven program to check whether a number is i) Even or odd, ii) Multiple of 17 or not, iii) Two digit number or not

Answers

Answered by TNShreyaDutta
0

Answer:

Explanation:

int main(){    

int a,c;    

printf("enter a number:");    

scanf("%d",&a);

printf("enter 1 to check the number is even or odd");

printf("enter 2 to check the number is multiple of 17 or not");

printf("enter 3 to check the number is two digit no or not");

printf("Enter a choice:");

scanf("%d",&c);  

switch(c){    

case 1:  

if(a%2==0)  {

printf("number even");    }

else{

printf("no is odd");}

break;    

case 2:  

if( a%17==0){

printf("number is multiple of 17");    }

else{printf("no is not multiple of 17");

break;    

case 3:    

if(a>=10 && a<=99){

printf("two digit no");}

else{printf("not a 2 digit no);}    

break;    

default:    

printf("wrong choice");    

}    

return 0;  

}  

Similar questions