954,498 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

plzz solve my problem

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();
}
sidrah
Newbie Poster
1 post since Nov 2005
Reputation Points: 10
Solved Threads: 0
 

Use [code] [/code] tags.

#include<conio.c>

->

#include<conio.h>
dwks
Posting Whiz in Training
269 posts since Nov 2005
Reputation Points: 185
Solved Threads: 28
 
if(choice == 's' || choice == 'v' || choice == 'a' || choice == 'f' || choice == 'q') 

default: 
cout<<"\nwrong choice entered\n";
break;

What are you trying to do there?

BTW, the standard C functionpow() is pretty much the same as

int Power(int time1, int time2)
dwks
Posting Whiz in Training
269 posts since Nov 2005
Reputation Points: 185
Solved Threads: 28
 

#include
#include
void main()
{
int A,S,a,b;
long int F=1;
clrscr();
printf("enter two number");
scanf("%d%d",&a,&b);
A=a+b;
printf("\nA=%d",A);
S=a-b;
printf("\nS=%d",S);
for(i=1;i<=a;i++)
{
F=F*i;
}
printf("\nthe factorial first number F(a)=%ld",F);

for(i=1;i<=b;i++)
{
F=F*i;
}
printf("\nthe factorial of second number F(b)=%ld",F);
getch();
}

suman680
Newbie Poster
1 post since Feb 2009
Reputation Points: 2
Solved Threads: 0
 

include

done == yes

Mike Savino
Newbie Poster
2 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You