{
int *ptr=(int*)malloc(sizeof(int));
*ptr=4;
printf("%d",(*ptr)+++*ptr++);
}
Answers were Sorted based on User's Feedback
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 |
Answer / prateek
compile error...!!
because malloc syntax is a=(int*)malloc(size of(int)
Is This Answer Correct ? | 1 Yes | 7 No |
find simple interest & compund interest
int i,j; for(i=0;i<=10;i++) { j+=5; assert(i<5); }
#include<stdio.h> int main() { int a=3,post,pre; post= a++ * a++ * a++; a=3; pre= ++a * ++a * ++a; printf("post=%d pre=%d",post,pre); return 0; }
Write a program that produces these three columns sequence nos. using loop statement Sequence nos. Squared Squared + 5 1 1 6 2 4 9 3 9 14 4 16 21 5 25 30
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
why nlogn is the lower limit of any sort algorithm?
#include<stdio.h> main() { register i=5; char j[]= "hello"; printf("%s %d",j,i); }
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,
void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }