Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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 meant by int fun const(int a, int b) { .... ... }

1 Answers  


Multiply an Integer Number by 2 Without Using Multiplication Operator

0 Answers  


How do you list a file’s date and time?

0 Answers  


How to removing white spces in c programming only bu using loops

2 Answers  


`write a program to display the recomended action depends on a color of trafic light using nested if statments

0 Answers  


34.what are bitwise shift operators? 35.what are bit fields? What is the use of bit fields in a structure declaration? 36.what is the size of an integer variable? 37.what are the files which are automatically opened when a c file is executed? 38.what is the little endian and big endian? 39.what is the use of fflush() function? 40.what is the difference between exit() and _exit() functions? 41.where does malloc() function get the memory? 42.what is the difference between malloc() and calloc() function? 43.what is the difference between postfix and prefix unary increment operators?

0 Answers  


What is a spanning Tree?

1 Answers   TCS,


Is main() is used in the program,,see below example? void main() { int i; for(i=0;i<10;i++) main(); } Then what is the output of the program?

6 Answers  


what are the stoge class in C and tel the scope and life time of it?

2 Answers   Tech Mahindra,


What is restrict keyword in c?

0 Answers  


Which is the best website to learn c programming?

0 Answers  


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

0 Answers  


Categories