main() {
int x=2, y=4
if ((x==2||y==4)
x++
y++
if (y==4+1)
{
x=x+y;
}
y++;
printf("The values of x and y are %d and %d."x,y);
}
What is the output?
Answer Posted / moolshankershukla
if use terminator after x++ and y++ and y=4 and ) missing
and {} missing then out put is
x=8 and y=6.
correct answer like this :
main ()
{
int x=2, y=4;
if ((x==2||y==4))
{
x++;
y++;
}
if (y==4+1)
{
x=x+y;
}
y++;
printf("The values of x and y are %d and %d."x,y);
}
out put is
x=8 and y=6.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Explain how can I convert a number to a string?
Is return a keyword in c?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
Can a local variable be volatile in c?
what is uses of .net
How do you initialize pointer variables?
What is wrong with this program statement?
What is the use of #define preprocessor in c?
What is clrscr ()?
What is the use of pointers in C?
Is null valid for pointers to functions?
What is floating point constants?
What is the purpose of void pointer?
what do the 'c' and 'v' in argc and argv stand for?
What are pointers? Why are they used?