View Single Post
  #1 (permalink)  
Old November 2nd, 2006, 09:18 PM
mastrgamr mastrgamr is offline
Authorized User
 
Join Date: Oct 2006
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mastrgamr
Default help with coding

can som1 tell me wats wrong with this code plz (im still learning and need to lear my mistakes)
here:
// mastrgamr's simple calculator!
#include <iostream.h>
void main()
{
 cout<<"to use my calculator follow the first command
 then u must hold shift and either A to add, S to subtract,
 M to multiply, or D to divide. insert another number and your
 answer should appear!"<< endl;
 float num2;
 float num1;
 char op;
 char (op==65 && op==83 && op==77 && op==68)
 float ans;
 cout << "insert number: ";
 cin >> num1;
 cin >> op;
  if (op==65);
     ans=num1+num2;
  if (op==83)
     ans=num1-num2;
  if (op==77)
     ans=num1*num2;
  if (op==68)
     ans=num1/num2;
 cin >> num2>> endl;
 cout << "=" << ans << endl;
}
i dont understand wat my CMD is talking about wen it anounces my errors

__________________
-Stuart Smith
Reply With Quote