Wednesday, 10 September 2014

Caculator C++ Code

18:33

Calculator Using If-else Statement:
Program Code;

#include <iostream>
#include <conio.h>
using namespace std;
int main()
{float x,y,z;
int operation;
cout<<"Enter a Number:";
cin>>x;
cout<<"Enter another Number:";
cin>>y;
cout<<"Enter 1 for Addition, 2 for Subtraction"<<endl<<"      3 for Multiplication, 4 for Division ";
cin>>operation;
if (operation ==1)
{cout<<"The Addition is "<<x+y<<endl;}
else
if(operation == 2)
{cout<<"The Subtraction is "<<x-y<<endl;}
else
if(operation == 3)
{cout<<"The Product is "<<x*y<<endl;}
else
{cout<<"The Division is "<<x/y<<endl;}
getche ();
return 0;

}

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 comments:

Post a Comment

 

© 2013 All in One. All rights resevered. Designed by Templateism

Back To Top