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
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
Science,
3 months ago
Science,
3 months ago
Political Science,
3 months ago
Accountancy,
7 months ago
Physics,
11 months ago
Hindi,
11 months ago