Sunday, August 2, 2009

C program &theres a menu,a-POWER,b-factorial,c-exi... and other if other character will print error use switch?

Menu


[A]power


[B]factorial


[C]exit


create a program that displays the menu shown above. if the user presses 'a' or 'A', then clear the screen, then ask the user to enter the base number..after which, ask the user to enter the power.then display the answer which is the base number raised to the power.after ans. displayed ,wait for a press then return to menu shown above. if user,presses 'b',the ask the user to enter the number,then display the ans. of the factorial of the no. after the answer has been displayed, wait for a key press and then return to main menu. if the user presses 'c' or 'C', the display "good bye" message then terminate the program. if the user presses a key other than the 3 letters, then display an error message that it has an invalid input.


requirements:


*use switch statement for the menu selection.


*make 2 user-defined functions, 1 for solving for the power and the other for the factorial.

C program %26amp;theres a menu,a-POWER,b-factorial,c-exi... and other if other character will print error use switch?
first code it yourself


then post the code if it does not work


No comments:

Post a Comment