main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
}
Answers were Sorted based on User's Feedback
Answer / susie
Answer :
556
Explanation:
The integer value 300 in binary notation is: 00000001
00101100. It is stored in memory (small-endian) as:
00101100 00000001. Result of the expression *++ptr = 2 makes
the memory representation as: 00101100 00000010. So the
integer corresponding to it is 00000010 00101100 => 556.
| Is This Answer Correct ? | 77 Yes | 8 No |
Answer / bidhu
I think the answer depends on compiler.
In Dev-C++ the result is cannot convert int* to char* error
In Code:Block it gives a warning but gives the result 556
| Is This Answer Correct ? | 1 Yes | 3 No |
write a origram swaoing valu without 3rd variable
main() { if ((1||0) && (0||1)) { 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=1; while (i<=5) { printf("%d",i); if (i>2) goto here; i++; } } fun() { here: printf("PP"); }
String reverse with time complexity of n/2 with out using temporary variable.
#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
Write a program that find and print how many odd numbers in a binary tree
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }
how many processes will gate created execution of -------- fork(); fork(); fork(); -------- Please Explain... Thanks in advance..!
how to test pierrot divisor
main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }