#include void main() { char ch; int n,n1,n2,f,s,t,i,junk; clrscr(); while(ch!='/') { printf("\nEnter Your Choice"); printf("\n1. Even or odd"); printf("\n2. Factorial"); printf("\n3. Fibonacci"); printf("\n4. Prime Number\n\t\t\t\t\tPress / to quit\n\tEnter your choice here:"); scanf("%c",&ch); switch (ch) { case '1':printf("\nEnter the number: "); scanf("%d",&n); if(n%2==0) printf("\n\t\t\t**%d is even**\n",n); else printf("\n\t\t\t**odd**\n"); break; case '2':printf("\nEnter a number: "); scanf("%d",&n); for (n1=f=1;n1<=n ;n1++) { f=f*n1; } printf("\n\t\t\t**Factorial of %d is %d**\n",n,f); break; case '3':printf("\nEnter the number for the Fabonacii series: "); scanf("%d",&n); f=0,s=1;n=n-2; printf("\n%d\n%d",f,s); while (n>0) { t=f+s; printf("\n%d",t); f=s,s=t,n--; } printf("\n"); break; case '4': printf("\nEnter a number: "); scanf("%d",&n); i=2; if(n==2) printf("\n\t\t\t**Not prime**\n"); else if(n==1) printf("\n\t\t\t**Prime**\n"); else { while (i<=n-1) { if(n%i==0) { printf("\n\t\t\t**Not Prime**\n"); break; }//if i++; }//while if(i==n) printf("\n\t\t\t**Prime**\n"); }//else break; case '/':break; default:printf("\n************************************"); printf("\n!!!Invalid choice press / to quit!!!"); printf("\n************************************\n"); }//switch scanf("%c",&junk); }//while getch(); }