{
int *ptr=(int*)malloc(sizeof(int));
*ptr=4;
printf("%d",(*ptr)+++*ptr++);
}

Answers were Sorted based on User's Feedback



{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }..

Answer / sowmya

4+5=9
*ptr+++*ptr++=4+5=9

Is This Answer Correct ?    31 Yes 5 No

{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }..

Answer / rohit choudhary

4+6
as *ptr++=4 hence *ptr=5
then ++*ptr=6
so 4+6=10
ans is 10

Is This Answer Correct ?    2 Yes 6 No

{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }..

Answer / janfel "genfil" vil

The answer is 8.

Is This Answer Correct ?    13 Yes 19 No

{ int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }..

Answer / prateek

compile error...!!
because malloc syntax is a=(int*)malloc(size of(int)

Is This Answer Correct ?    1 Yes 7 No

Post New Answer

More C Code Interview Questions

union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4

3 Answers   HCL,


How can you relate the function with the structure? Explain with an appropriate example.

0 Answers  


void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }

1 Answers  


main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

2 Answers   HP,


main() { int i=0; while(+(+i--)!=0) i-=i++; printf("%d",i); }

9 Answers   CSC, GoDB Tech, IBM,


main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.

2 Answers  


Write a routine that prints out a 2-D array in spiral order

3 Answers   Microsoft,


void main() { char a[]="12345\0"; int i=strlen(a); printf("here in 3 %d\n",++i); }

3 Answers  


#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer

1 Answers  


main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above

2 Answers   HCL,


Hi, i have a project that the teacher want a pyramid of numbers in C# or java...when we click a button...the pyramid should be generated in a listbox/or JtextArea...and the pyramid should have the folowing form: 1 232 34543 4567654 567898765 67890109876 7890123210987 890123454321098 90123456765432109 0123456789876543210 Plz help with codes...didn't find anything on the net.

0 Answers  


Categories