May 28, 2016 at 5:48pm UTC
For this I am suppose to give an expected output. I got some of it, but some of it i dont. Does anyone know how to do an expected output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
int main().
{
int someInt,
w = 5, x = 9, y = 2, z = 7;
char someChar = 'A' ;
cout << "operator precedence \n" ;
cout << (x - 1) / (x - w) * y << endl;
cout << (x - 1) / ((x - w) * y) << endl;
cout << static_cast <double >(x) / y << endl;
cout << x / y << endl;
cout << (w + x % 7 / y) << endl;
cout << (abs(y - w) + sqrt(x)) << endl;
someInt = someChar;
cout << someChar << " "
<< someInt << endl;
return 0;
}
Last edited on May 31, 2016 at 5:49pm UTC
May 28, 2016 at 7:31pm UTC
Did you try running it?
1 2 3 4 5 6 7 8
operator precedence
4
1
4.5
4
6
6
A 65
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
Last edited on May 28, 2016 at 7:57pm UTC
May 28, 2016 at 7:33pm UTC
yes. that is exactly what i got. So there is no such thing as an expected output for int someInt? or the other ones?