Scientific Calculator In C++

#include<iostream>
#include<stdio.h>
#include<conio.h>
#include<math.h>
using namespace std;

void main()
{
start:
       next:
int choise,num1,num2;
double a,b;
unsigned long fact=1;
cout<<"\t\t\t *****Scientific Calculator*****  \n"<<endl;
cout<<"1.Addition\n2.Subtraction\n3.Multiplication\n4.Divission\n5.SinQ\n6.CosQ\n7.TanQ\n8.Sqr\n9.Sqr.root\n10.Factorial\n11.Mod\n12.Permutation\n13.Absolute\n14.Ceil\n15.floor\n16.Exit\n\nEnter Your Desire Choise\n";
cin>>choise;
if(choise==1)
{
cout<<"\nEnter first Number\n";
cin>>num1;
cout<<"\nEnter second number\n";
cin>>num2;
cout<<"The Addition is "<<num1+num2<<endl;

}
else if(choise==2)
{
cout<<"\nEnter first Number\n";
cin>>num1;
cout<<"\nEnter second number\n";
cin>>num2;
cout<<"The Subtraction is "<<num1-num2<<endl;

}
else if(choise==3)
{
cout<<"\nEnter first Number\n";
cin>>num1;
cout<<"\nEnter second number\n";
cin>>num2;
cout<<"The Multiplication is "<<num1*num2<<endl;

}
else if(choise==4)
{
cout<<"\nEnter first Number\n";
cin>>num1;
cout<<"\nEnter second number\n";
cin>>num2;
cout<<"The Divission is "<<num1/num2<<endl;

}
else if(choise==5)
{
cout<<"\nEnter the  Number that you want to take its sinQ\n";
cin>>a;
cout<<"The SinQ of given number is "<<(sin(a))<<endl;

}
else if(choise==6)
{
cout<<"\nEnter the  Number that you want to take its cosQ\n";
cin>>a;
cout<<"The CosQ of given number is "<<(cos(a))<<endl;

}
else if(choise==7)
{
cout<<"\nEnter the  Number that you want to take its tanQ\n";
cin>>a;
cout<<"The TanQ of given number is "<<(tan(a))<<endl;

}
else if(choise==8)
{
cout<<"\nEnter the  Number i.e Base\n";
cin>>a;
cout<<"\nEnter the Power\n";
cin>>b;
cout<<"\nThe Given base"<<a<<"of power"<<b<<"is"<<(pow(a,b))<<endl;
}
else if(choise==9)
{
cout<<"\nEnter the  Number that you want to take its Square root\n";
cin>>a;
cout<<"The Square root of given number is "<<(sqrt(a))<<endl;
}
else if(choise==10)
{
cout<<"\nEnter the  Number that you want to take its factorial\n";
cin>>a;
for(int i=1;i<a;i++)
{
       fact*=i;
}
cout<<"\nFactorial of "<<a<<" is : "<<fact<<endl;
}

else if(choise==11)
{
cout<<"\nEnter the two Numbers that you want to take its Modulous\n";
cout<<"\nEnter 1st number\n";
cin>>num1;
cout<<"\nEnter the divisor\n";
cin>>num2;
cout<<"The Modulous of given number is : "<<(num1 % num2)<<endl;
}

else if(choise==12)
{
cout<<"\nEnter the  Numbers that you want to take its Permutation\n";
cin>>a;
//cout<<"The TanQ of given number is "<<(std::next_permutation("a1"));
}
else if(choise==13)
{
cout<<"\nEnter the like Number (10 etc) that you want to take its Absolute\n";
cin>>a;
cout<<"The TanQ of given number is :"<<(abs(a))<<endl;
}
else if(choise==14)
{
cout<<"\nEnter the like Number that you want to take its Ceil\n";
cin>>a;
cout<<"The TanQ of given number is "<<(ceil(a))<<endl;
}
else if(choise==15)
{
cout<<"\nEnter the like Number (10 etc) that you want to take its Absolute\n";
cin>>a;
cout<<"The TanQ of given number is "<<(floor(a))<<endl;
}
else
{
       exit(0);
}


getch();
}

No comments:

Post a Comment