Heres the basic code i have so far....
Code:
#include<iostream>
using namespace std;
int main()
{
int a,b,res;
char op;
cout<<"Please Enter A Number and +,-,*,or/ then another Number-> ";
while(cin>>a>>op>>b){
switch(op){
case'+':res = a + b;
break;
case'-':res = a - b;
break;
case'*':res = a * b;
break;
case'/':if(a == 0 || b ==0)
cout<<"Error: division by zero: ";
else
res = a / b;
break;
default: cout<<"Error: "<<op<<" is not accepted\n";
}
cout<<res<<": ";
}
return 0;
}
Its just not what i want though... I want an array[10] and my switch and loop to be right... which i dont' think it is..
Thanks!