What will be the output of the following coded segment if x = 10 and y = 20? if(x%10 == 0 || y <= x/2) { if (y%20 < 0)

Status
Not open for further replies.

Konex_

Commendable
Sep 5, 2016
1
0
1,510
0
What will be the output of the following coded segment if x = 10 and y = 20?

if(x%10 == 0 || y <= x/2)
{
if (y%20 < 0)
{
x++;
x = y%10 + y/2;
cout << "X = ” << x++;
}
else
{
x = x-- + ++y - y%5;
cout << "\nX = ” << x--;

if(x >= y)
{
x++;
y = x * 2 + y;
cout << "\nY = ” << y;
}
}
}
 

Saga Lout

Olde English
Moderator
We wouldn't be doing you any favours by helping you with your homework. the Internet has the answers to everything but you're better off researching your problem properly rather than asking the direct question.

Another point it that there are Trolls who would give you the wrong answer for what they see as fun.
 
Status
Not open for further replies.
Thread starter Similar threads Forum Replies Date
P Apps General Discussion 2
A Apps General Discussion 5
clintox Apps General Discussion 3
T Apps General Discussion 1
R Apps General Discussion 2
O Apps General Discussion 1
I Apps General Discussion 2
Jmurph01 Apps General Discussion 1
Zaporro Apps General Discussion 1
K Apps General Discussion 4
Q Apps General Discussion 2
Can You Help Me Please Apps General Discussion 1
H Apps General Discussion 3
M Apps General Discussion 1
K Apps General Discussion 2
deadshots Apps General Discussion 7
S Apps General Discussion 2
A Apps General Discussion 5
G Apps General Discussion 2
D Apps General Discussion 1

ASK THE COMMUNITY