simple calculator at c++

// this program performs addition, subtraction, multiplication and subtraction.
void main(){
float x=0,y=0,result=0;
char o;
cout<<"input the operation like this fuger (1+2)\n\n";
switch (o){
case '+':result=x+y;
case '-':result=x-y;
case '*':result=x*y;
break ;
case '/':result=x/y;
break ;
default:cout<<"the operation not defind\n";}
cout<<"The result is = "<<result<<"\n\n";
closed account (Dy7SLyTq)
a) should be int main.
b) should be iostream
c) what is your question?
1- where is using namespace std;
2- if i wanna calculate this : 1+2+3 , in your calculator the result is : 3 , it can just calculate the two first number .
PLEASE goto the beginner forums for things like this... and use
[code]//Code in here[/code]
code tags.

This forum area is specifically for Windows programming (i.e. the WinAPI)

Also as DTS mentioned you don't have an actual question to answer... Maybe you should just go read the forum rules instead of me ranting?

No-one can help you because we don't know what you want.
Topic archived. No new replies allowed.