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 ? | 25 Yes | 6 No |
Post New Answer View All Answers
Are the outer parentheses in return statements really optional?
What is the size of structure pointer in c?
What is merge sort in c?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What is a list in c?
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
Write a program to check whether a number is prime or not using c?
Can we add pointers together?
Explain the difference between getch() and getche() in c?
Explain how can I make sure that my program is the only one accessing a file?
What are categories used for in c?
What is the difference between formatted&unformatted i/o functions?
I have a varargs function which accepts a float parameter?
What are the advantage of c language?