main()
{
int *ptr=(int*)malloc(sizeof(int));
*ptr=4;
printf("%d",(*ptr)+++*ptr++);
}
Answers were Sorted based on User's Feedback
Answer / s k dubey
hello ,if problem is..
int *p=(int*)malloc(sizeof(int));
*p=4;
printf("%d",(*p)+++(*p)++);
o/p is 9;
it is just similar the case of post incremental operation of
variable like i+++i++.
| Is This Answer Correct ? | 158 Yes | 14 No |
Answer / vishnu
hi all,
i think *ptr=(int*)malloc(size of (int));
*ptr=4;
mean malloc(size of (int)) is used to allocate memory of only 4.
hence(*ptr)+++*ptr++)=4+4=8
| Is This Answer Correct ? | 28 Yes | 43 No |
Answer / ankit panwar
*ptr++ : it just increments the pointer not the value it is
pointing to..
++*ptr : it increments the value the pointer points to but
not the pointer..
here
(*ptr++) + (++*ptr) = 0 + (4+1) = 5
so the answer will definately be 5
| Is This Answer Correct ? | 2 Yes | 31 No |
Answer / aravind
I think it gives syntax error because there is no operation in C which says P+++ just P++.If he can seperate that one + than the above ans is will be 5+5=10.
| Is This Answer Correct ? | 5 Yes | 35 No |
Answer / manil shrama
hello all..........
here malloc function reserves a memory space for an integer,whose adddess is pointed by integer pointer p.
Now at this memory space,4 istored by using *p = 4
(*p)+++means,*p=*p+2, (4+2=6)
and ptr++ means,*ptr=*ptr+1, (4+1=5)
now 4*5=30 is required answer
k bye.....tc
| Is This Answer Correct ? | 6 Yes | 49 No |
Explain what does the format %10.2 mean when included in a printf statement?
WHO WROTE C LANGUAGE?
what is the return type of printf
Why is C called a middle-level language?
Write a code on reverse string and its complexity.
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.
how to execute a program using if else condition and the output should enter number and the number is odd only...
12344321 123 321 12 21 1 1 how i print this program??
5 Answers DSR Management, Winit,
What does the characters “r” and “w” mean when writing programs that will make use of files?
how to implement stack work as a queue?
What is line in c preprocessor?
develop algorithms to add polynomials (i) in one variable