Last active
August 29, 2015 14:22
-
-
Save MohamedRamadanSaad/2e08dae42a0a1f3f15fe to your computer and use it in GitHub Desktop.
C++ , calculation by do while , switch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() | |
{ | |
cout<<"********************************************************************************\n"; | |
cout<<"**** Designed By: Mohamed Ramadan The Caculation *****\n"; | |
cout<<"********************************************************************************\n"; | |
int x[2]; | |
char y; | |
int d=1; | |
do{ | |
if(x[1]==0) | |
return 0; | |
cout<<"Enter The Operation ::"; | |
cout<<endl; | |
cin>>x[1]; | |
if(x[1]==0) | |
break; | |
cin>>y; | |
cin>>x[2]; | |
switch(y){ | |
case('+'): | |
cout<<x[1]+x[2]; | |
break; | |
case('-'): | |
cout<<x[1]-x[2]; | |
break; | |
case('*'): | |
cout<<x[1]*x[2]; | |
break;} | |
cout<<endl;}while(d=1); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment