Wednesday, 10 September 2014

Calculator Using Switch Statement

18:34

Program for Calculator of arithmetic operation:

#include <iostream>
#include <conio.h>
using namespace std;
int main()
{char operation;
int a,b;
      cout<<"Enter first Number: ";
      cin>>a;
      cout<<"Enter second Number: ";
      cin>>b;
      cout<<"Enter an operation arithmetic operation do you want: ";
      cin>>operation;
      switch (operation)
      {
      case '+' :
           
            cout<<"The Addition of numbers= "<<a+b;
            break;
      case '-':
      cout<<" The Subtraction of numbers= "<<a-b;
            break;
      case '*':
            cout<<"The Multiplication of numbers= "<<a*b;
            break;
      case '/':
            cout<<"The Division of numbers= "<<a/b<<endl;
            break;
      }
      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