Chapter 4: Case Control Structure (Let Us C)
Write a menu driven program which has following options: 1. Factorial of a number. 2. Prime or not 3. Odd or even 4. Exit // Let Us C (Chapter 4 : Case Control Structure) : Program-1 /* Write a menu driven program which has following options: 1. Factorial of a number. 2. Prime or not 3. Odd or even 4. Exit*/ #include<stdio.h> void main() { int choice,N,Fact,i; clrscr(); while(1) { printf("\n------------------------------------------------------"); printf("\nChoices are as below\n"); printf("1:Factorial\t"); printf("2:Prime\t\t"); printf("3:Odd/Even\t"); printf("4:Exit"); printf("\nEnter your choice:"); scanf("%d",&choice); switch(choice) { case 1 : printf("Enter the No.: "); scanf("%d",&N); Fact=1;