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
What is scope rule of function in c?
What does 3 periods mean in texting?
What is structure data type in c?
How can a process change an environment variable in its caller?
What are the 5 data types?
How pointers are declared?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
Write a program to display all the prime nos from 1 to 1000000, your code should not take time more than a minute to display all the nos.
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
What is pointers in c?
Does c have function or method?
What is meant by gets in c?
What is the benefit of using #define to declare a constant?
How does sizeof know array size?
What is cohesion and coupling in c?