Dec 15, 2014 at 3:59pm UTC
Write your question here.
Which operator will be used here and why?
[u] I want to create a short program that is : User inputs 2 numbers answer should be shown which mathematics operator user wants to use i mean " +,-,/,% "
sorry for bad english
Last edited on Dec 16, 2014 at 4:11pm UTC
Dec 15, 2014 at 6:19pm UTC
write in "Beginners" section to get answer quicker.
did you learn, cin/cout/ if/else ? you need these to program it.
Dec 16, 2014 at 4:12pm UTC
Yes i have learnt it but I don't know how to assign variables in an If statement
Dec 16, 2014 at 6:16pm UTC
What did we use char and equal to operator for?
Dec 17, 2014 at 5:17am UTC
you need two variable that will hold the " 2 integers" and one for the operator
you may also use switch statements
1 2 3 4 5 6
switch ( operation ) {
case '+' :/* add*/ break ;
case '-' :/* subtract*/ break ;
case '*' :/* multiply */ break ;
case '/' : /* divide */ break ;
}
you just have to imagine how your program will flow.
example:
you cannot compute/ solve a problem without seeing it
and then vice versa
Last edited on Dec 17, 2014 at 5:20am UTC