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 |
Write a single line c expression to delete a,b,c from aabbcc
program to find magic aquare using array
void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above
void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }
main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
why nlogn is the lower limit of any sort algorithm?
how to swap 3 nos without using temporary variable
Write a C program to add two numbers before the main function is called.
int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }