main()
{
int a=2,*f1,*f2;
f1=f2=&a;
*f2+=*f2+=a+=2.5;
printf("\n%d %d %d",a,*f1,*f2);
}
Answers were Sorted based on User's Feedback
Answer / odelu vanga
*f2=*f2+(*f=*f2+(a=a+2.5))
a=a+2.5=4
so *f2=4
*f2=*f2+4=8
now *f2=8
so *f2=*f2+8=16
ans:- 16 16 16
| Is This Answer Correct ? | 18 Yes | 3 No |
Answer / susie
Answer :
16 16 16
Explanation:
f1 and f2 both refer to the same memory location a. So
changes through f1 and f2 ultimately affects only the value
of a.
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / kamlesh meghwal
LOL@Govind Verma....how u r gettin 888..hehe..!!1
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / forgot_my_name
Since we are modifying same variable three times in the same line (before sequence point ) so we broke the rules, so whatever compiler says would be right..
@Kamlesh Meghwal : In GCC compiler ans is 8 8 8.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / vamshikrishna
12 12 12
explanition.
printf takes the last updated value and prints for every var
i.e,
a=a+2.5=4
so f2=4
f2=f2+4=8
here again f2 =4 "since f2=&a"
so f2=f2+4=12
| Is This Answer Correct ? | 3 Yes | 3 No |
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }
what will be the output of this program? void main() { int a[]={5,10,15}; int i=0,num; num=a[++i] + ++i +(++i); printf("%d",num); }
How to read a directory in a C program?
main() { if (!(1&&0)) { 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
#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?
given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
write a simple calculator c program to perform addition, subtraction, mul and div.
0 Answers United Healthcare, Virtusa,
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,
print a semicolon using Cprogram without using a semicolon any where in the C code in ur program!!
35 Answers Tata Elxsi, TCS, VI eTrans,
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }