int i;
i=2;
i++;
if(i=4)
{
printf(i=4);
}
else
{
printf(i=3);
}
output of the program ?

Answers were Sorted based on User's Feedback



int i; i=2; i++; if(i=4) { printf(i=4); } else { ..

Answer / sukant

The syntax for the if statement is also not correct..
The conditional assignment includes two == rather than a single =...
so,, the if statement wont consider that as a conditional statement and come out of it..
And, it will give an error in the printf(i=3); as the syntax is not apt.

Is This Answer Correct ?    0 Yes 0 No

int i; i=2; i++; if(i=4) { printf(i=4); } else { ..

Answer / khaja

output is 3

Is This Answer Correct ?    1 Yes 2 No

int i; i=2; i++; if(i=4) { printf(i=4); } else { ..

Answer / fwfwgq

It will give segmentation fault in linux

Is This Answer Correct ?    6 Yes 8 No

int i; i=2; i++; if(i=4) { printf(i=4); } else { ..

Answer / gowtham

answer is three

Is This Answer Correct ?    1 Yes 6 No

int i; i=2; i++; if(i=4) { printf(i=4); } else { ..

Answer / fazlur

the output will b 4.

Is This Answer Correct ?    6 Yes 18 No

Post New Answer

More C Interview Questions

What is sizeof c?

0 Answers  


difference between i++* and *++i

6 Answers   IBM,


How many types of sorting are there in c?

0 Answers  


application attempts to perform an operation?

0 Answers  


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

0 Answers  






Are there constructors in c?

0 Answers  


what is the difference between #include<stdio.h> and #include"stdio.h" ?

6 Answers   TCS,


How to access or modify the const variable in c ?

16 Answers   HCL, HP,


printf("%d",(printf("Hello")); What it returns?

32 Answers   TCS,


An instruction which is analysed and acted upon by the processor prior to the compiler going its work a) directive b) constructive c) constant d) absolute mode

0 Answers  


Explain how are 16- and 32-bit numbers stored?

0 Answers  


Consider a language that does not have arrays but does have stacks as a data type.and PUSH POP..are all defined .Show how a one dimensional array can be implemented by using two stacks.

3 Answers   Google,


Categories