Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  mine
Language: C/C++
Code:
     #include<iostream.h>
void main()
{
    int a,b,Result;
    char ch;
    cout<<"Enter two numbers : ";
    cin>>a>>b;
    cout<<"Enter a mathematical operator(+,-,*,/,%)"; 
    cin>>ch;
    switch(ch)
    {
        case'+': Result = a+b
        cout<<"Addition of"<<a "and"<<b "="<<Result;
        break;
        case'-': Reselt = a-b
        cout<<"Subtraction of"<<a "and"<<b "="<<Result;
        break;
        case'*': Result= a*b
        cout<<"Multiplication of"<<a "and"<<b "="<<Result;
        break;
        case'/' : Result= a/b
        cout<<"Division of"<<a "and"<<b "="<<Result;
        break;
        case'%' : Result= a%b
        cout<<"Modular division of"<<a "and" <<b "="<<Result;
        break;
        default : cout<<"Incorrect Input";
}
}
     
          
Comments: