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?


Answers were Sorted based on User's Feedback



main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / pandu

x=8,y=6

Is This Answer Correct ?    20 Yes 3 No

main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / rajesh

Error will be occur because the variable declaration
does`t intilized terminate symbol(;), and again same
mistake in line 5 and line 6.

Is This Answer Correct ?    7 Yes 0 No

main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / ganesh bankar

There is a errsor at compile time because some statements
are not terminated by ";".

Is This Answer Correct ?    5 Yes 0 No

main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / 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

main() { int x=2, y=4 if ((x==2||y==4) x++ y++ if (y==4+1) ..

Answer / kirthi s

x=2.y=4

Is This Answer Correct ?    2 Yes 14 No

Post New Answer

More C Interview Questions

What is uint8 in c?

0 Answers  


How can a program be made to print the name of a source file where an error occurs?

0 Answers  


how to print this pyramid * * * * * * * * * * * * *

2 Answers  


the number of measuring units from a arbitrary starting point in a record area or control block to some other point a) branching b) recording pointer c) none d) offset

0 Answers  


write a program that types this pattern: 12345678987654321 12345678 87654321 1234567 7654321 123456 654321 12345 54321 1234 4321 123 321 12 21 1 1

0 Answers  






where do we use volatile keyword?

1 Answers  


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

2 Answers   HCL, IBM, Satyam, Vimal, Vimukti Technologies,


Write a main() program that calls this function at least 10 times. Try implementing this function in two different ways. First, use an external variable to store the count. Second, use a local variable. Which is more appropriate?

2 Answers  


1.what are local and global variables? 2.what is the scope of static variables? 3.what is the difference between static and global variables? 4.what are volatile variables? 5.what is the use of 'auto' keyword? 6.how do we make a global variable accessible across files? Explain the extern keyword? 7.what is a function prototype? 8.what does keyword 'extern' mean in a function declaration?

2 Answers   nvidia,


What is data type long in c?

0 Answers  


How can I increase the allowable number of simultaneously open files?

1 Answers   ABC,


logic for generating all the combinations of the any number of given letters. ex::::::::: if a,b,c,d are given the o/p should be abcd,dcba,dbac,bcad,................ 4*3*2*1 combinations............

2 Answers   Infosys,


Categories