main()
{
int i = -3,j=2,k=0,m;
m= ++i || ++j && ++k;
printf("%d%d%d",i,j,k,m);
}

Answer Posted / ep

After the execution of the m evaluation the variables can be:

i = -2
j = 2
k = 0
m = 1

All of of this is because compilers do NOT completely
evalute expressions if they can short cut the evaluation.

Anyway, this is very bad programming.

Is This Answer Correct ?    18 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

597


What is hungarian notation? Is it worthwhile?

692


the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above

602


Find duplicates in a file containing 6 digit number (like uid) in O (n) time.

2602


What is a c token and types of c tokens?

585






What is a program flowchart and how does it help in writing a program?

656


Why do we use c for the speed of light?

603


Where are local variables stored in c?

570


What is assert and when would I use it?

573


How many levels deep can include files be nested?

646


What is the use of putchar function?

646


Is c object oriented?

536


How can you access memory located at a certain address?

663


Explain how can I write functions that take a variable number of arguments?

608


Is c language still used?

533