main()
{
int i=4,j=7;
j = j || i++ && printf("YOU CAN");
printf("%d %d", i, j);
}
Answer / susie
Answer :
4 1
Explanation:
The boolean expression needs to be evaluated only till the
truth value of the expression is not known. j is not equal
to zero itself means that the expression’s truth value is 1.
Because it is followed by || and true || (anything) => true
where (anything) will not be evaluated. So the remaining
expression is not evaluated and so the value of i remains
the same.
Similarly when && operator is involved in an expression,
when any of the operands become false, the whole
expression’s truth value becomes false and hence the
remaining expression will not be evaluated.
false && (anything) => false where (anything) will
not be evaluated.
Is This Answer Correct ? | 5 Yes | 0 No |
main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above
main() { int i=400,j=300; printf("%d..%d"); }
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,
program to find magic aquare using array
main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
What is the output of the program given below main() { signed char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }
how to test pierrot divisor
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
C program to print magic square of order n where n > 3 and n is odd
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }