Hye........
plzzz solve my problem my problem is that in this progamme
is runing but i dont understand that how in the end of the programme there is some thinds are missing that are
when programme finished then it print the
Thanks for using the program.
and this progamme is runinig in this way
for example
The program should also have a menu like.
Addition : A
Subtraction : S
Power : P
Factorial : F
Quit : Q
Please enter the option:
The program should repeat until the user wants to quit.
Sample Output
Please enter the first number: 11
Please enter the second number: 3
Addition : A
Subtraction : S
Power : P
Factorial : F
Quit : Q
Please enter the option: A
The Result after Addition is: 14
Do you want to continue? Y
//After clearing the text window
Addition : A
Subtraction : S
Power : P
Factorial : F
Quit : Q
Please enter the option: S
The Result after Subtraction is: 8
Do you want to continue? Y
//After clearing the text window
Addition : A
Subtraction : S
Power : P
Factorial : F
Quit : Q
Please enter the option: P
The Result after taking Power is: 1331
Do you want to continue? Y
//After clearing the text window
Addition : A
Subtraction : S
Power : P
Factorial : F
Quit : Q
Please enter the option: Q
Thanks for using the program.
but that i have make it but there is many problems
plzzzzzzzz can u help me in this problem
BYE take crae
bye
THE ORGRAMME IS
#include<iostream.h>
#include<conio.c>
char choice;
int time1;
int time2;
char cnt;
int result;
//**********************************************************
int Power(int time1, int time2)
{
int exponentResult=1;
for(int i=0 ; i<time2 ; i++)
exponentResult=time1 * exponentResult;
return exponentResult;
}
//***************************************************************
void Factorial(int time1, int* factorialResult)
{
*factorialResult=1;
for(int i=time1 ; i>0 ; i--)
*factorialResult=*factorialResult * i;
}
/******************************************************************/
int sum (int time1, int time2)
{
int sum;
sum = time1 + time2;
return sum;
}
/******************************************************************/
int multiply(int time1, int time2)
{
int multy;
multy = time1 * time2;
return multy;
}
/****************************************************/
int main()
{
do
{
cout<<"\n Enter first number: ";
cin>>time1;
cout<<"\n Enter second number: ";
cin>>time2;
cout<<"\n\tEnter S for Sum\n";
cout<<"\tEnter V to find power\n";
cout<<"\tEnter A to Multiply\n";
cout<<"\tEnter F for the factorials\n";
cout<<"\tEnter Q to Quit\n";
cout<<"\n\tPlease enter the option: ";
cin>>choice;
switch (choice)
{
case 's':
cout<<" Result after addition is : "<<sum(time1, time2)<<endl;
break;
case 'a':
cout<<" Result of Multiply first & second : "<<multiply(time1, time2)<<endl;
break;
case 'v':
cout<<" Result of power integers is : "<<Power(time1,time2)<<endl;
break;
case 'f':
Factorial(time1,&result);
cout<<endl<<"The result of factorail of first number is : "<<result;
Factorial(time2,&result);
cout<<endl<<"The result of factorail of Second number is : "<<result;
break;
case 'q':
exit(0);
break;
if(choice == 's' || choice == 'v' || choice == 'a' || choice == 'f' || choice == 'q')
default:
cout<<"\nwrong choice entered\n";
break;
}
cout<<"\nDo you want to continue? Y: ";
cin>>cnt;
}
while(cnt == 'y');
clrscr();
getch();
}