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 |
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
main() { static int var = 5; printf("%d ",var--); if(var) main(); }
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
write a c-program to find gcd using recursive functions
main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }
write a c-program to display the time using FOR loop
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }
There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.
main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }