Print Friendly and PDF
#include<iostream>
#include<cstdlib>
using namespace std;

int main()

{

int num1;
int num2;
char choice;

int sum ;
start:
cout <<" plz enter the correct choice ..."<<endl;
cout<<"press A for finding the sum of two number "<<endl ;
cout<<"press F for finding the factorial of any number "<<endl;
cout<<"press R for restart the programm "<<endl;
cout<<"press Y for exist the programm"<<endl;
cin>>choice;
system("colours 5f");

system("CLS");
switch(choice)

{

case 'Y':
return 0;

case 'a':

cout<<"enter the value of two numbers"<<endl;

cin>>num1;
cin>>num2;
sum = num1+num2 ;
cout <<"sum is ="<<sum<<endl;
goto start;

break ;
case 'F':
int g , factorial;
cout<<"finding the factorial of any number "<<endl ;
cin >>g;
for(int i=1;i<=g ;i++)
{
factorial*=g;
}
cout<<"factorial is ="<<factorial<<endl;

goto start ;

// break ;
// case 'R ':

// goto start ;

// break ;
system("CLS");

}

}
zubairsaif

Zubair saif

A passionate writer who loves to write on new technology and programming

Post A Comment:

0 comments: