اس کوڈ کو کاپی کرکے پیسٹ کریں
dave- سی پلس پلس
میں اور رن کریں
#include <cstdlib>
#include <iostream>
#include<math.h>
using namespace std;
int main(int argc, char *argv[])
{
float a,b;
int c;
int z;
cout<<"\t\t *****\n****\n***\n**\n* Calculater By Rizwan *****\n****\n***\n**\n* "<<endl;
cout<<"Press 1 For Addition"<<endl;
cout<<"Press 2 For Minus "<<endl;
cout<<"Press 3 For Multiply"<<endl;
cout<<"press 4 For Deviding"<<endl;
cout<<"press 5 For Multiple "<<endl;
cout<<"press 6 For finding temprature •c to kalvin"<<endl;
cout<<"press 7 For finding temprature F to •c"<<endl;
cout<<"press 8 For finding temprature •c to F"<<endl;
cout<<"Press 9 For Circum Ference and area Of circle\n";
cin>>z;
if(z==1)
{cout<<" \t\t Addition \n Enter First Number"<<endl;
cin>>a;
cout<<"Enter second Number"<<endl;
cin>>b;
cout<<"Sum is="<<a+b<<endl;
}
else if(z==2)
{cout<<" \t\t Subtraction \n Enter First Number"<<endl;
cin>>a;
cout<<"Enter second Number"<<endl;
cin>>b;
cout<<"Diffrence is="<<a-b<<endl;
}
else if(z==3)
{cout<<" \t\t Multiplecation \n Enter First Number"<<endl;
cin>>a;
cout<<"Enter second Number"<<endl;
cin>>b;
cout<<"Result is is="<<a*b<<endl;
}
else if(z==4)
{cout<<" \t\t Deviding and Reminder \n Enter First Number"<<endl;
cin>>a;
cout<<"Enter second Number"<<endl;
cin>>b;
cout<<"Result is="<<a/b<<endl;
}
else if(z==5)
{cout<<" \t\t Multiple \n Enter First Number"<<endl;
cin>>a;
cout<<"Enter second Number"<<endl;
cin>>b;
cout<<"Result is="<<a*b<<endl;
}
else if(z==6)
{cout<<" \t\t Temprature \n Enter Degree centigrade temprature"<<endl;
cin>>a;
cout<<"Kalvin temprature is="<<a+273<<"K"<<endl;
}
else if(z==7)
{cout<<" \t\t Temprature \n Enter FarinHight temprature"<<endl;
cin>>a;
cout<<"DegreeCentigrade Temprature is="<<(5/9*a)-32<<endl;
}
else if(z==8)
{cout<<" \t\t Temprature \n Enter DegreeCentigrade temprature"<<endl;
cin>>a;
cout<<"Farin Temprature is="<<(9/5*a)+32<<endl;
}
else if(z==9)
{cout<<"Enter Radious of Circle"<<endl;
cin>>a;
cout<<"press 1 for area and 2 for circum ference"<<endl;
cin>>c;
if(c==1)
cout<<"Area is="<<a*a*3.14<<endl;
else if(c==2)
cout<<"Circum ference is="<<2*3.14*a<<endl;
}
else
cout<<"invalid input\n";
system("PAUSE");
return EXIT_SUCCESS;
}
Bookmarks