Template by:
Free Blog Templates

Saturday, November 7, 2009

Menu Program Using Custom Header Files | C Programming

//wap to create a menu where we have following options
1 for checking number is palindrome or not
2 for checkin’ the number is even or odd
3 for finding the factorials of number
4 to check the given no is armstorng or not
5 to exit the program

#include
#include
#include
#include”pal.c”
#include”arm.c”
#include”fact.c”
#include”evenodd.c”
void main()
{
int n,a;
charb=’y’;
clrscr();
do
{
printf(“\n\n Enter your choice\n****Menu****\n1 to check palindrom \n2 to check evenodd\n3to find tactorial\n4 to check armstrong\n5 to exit the program “);
scanf(“%d”,&a);

switch(a)
{
case 1: pal(a); break;
case 2: evenodd(a); break;
case 3: fact(a); break;
case 4: arm(a); break:
default: exit();
printf(“\n Do you want to continue(y/n)”);
scanf(“%c”,&b);
}while(b==’y’);
getch();
}
o/p→









0 comments:

Post a Comment

If you have any proble fee free to ask it here