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
write a programe to accept any two number and check the following condition using goto state ment.if a>b,print a & find whether it is even or odd and then print.and a
How do I use strcmp?
Write the program that calculates and prints the average of several integers. Assume that the last value read is sentinel 9999.
What does main () mean in c?
Is c programming hard?
Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..
Write a program to swap two numbers without using third variable in c?
What is nested structure with example?
How can I swap two values without using a temporary?
What is the right type to use for boolean values in c?
Why isn't any of this standardized in c? Any real program has to do some of these things.
What are the advantages of using new operator as compared to the function malloc ()?
How can a program be made to print the name of a source file where an error occurs?
What is the function of multilevel pointer in c?
What do the functions atoi(), itoa() and gcvt() do?