main()
{
int i = -3,j=2,k=0,m;
m= ++i || ++j && ++k;
printf("%d%d%d",i,j,k,m);
}
Answer Posted / harend
results :
i=-2
j=2
k=0
m=1
First, the '&&' part is to be considered over '||'.
AS follow: m = ++i||++j&&++k (is given)
what ever be the result of (++j&&++k),the value of m =1
,since the new value i= -2 (i.e a non zero value so taken as
true or 1)
so,
1||(++j&&++k) will always be true, that is 1 . compiler
ignores ++j ,++k and only consider ++i.
thank you !
Is This Answer Correct ? | 24 Yes | 6 No |
Post New Answer View All Answers
Tell me when is a void pointer used?
What is the difference between char array and char pointer?
How can I delete a file?
What is the use of a static variable in c?
Can I initialize unions?
Differentiate between new and malloc(), delete and free() ?
What are types of preprocessor in c?
What does the c preprocessor do?
What are runtime error?
What is malloc return c?
What is a built-in function in C?
What is the difference between text and binary modes?
Explain what is the difference between text files and binary files?
What are the advantages of Macro over function?
How to check whether string is a palindrome, WITHOUT USING STRING FUNCTIONS?