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 |
Write, efficient code for extracting unique elements from a sorted list of array. e.g. (1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9) -> (1, 3, 5, 9).
13 Answers Intel, Microsoft, TCS,
Give a one-line C expression to test whether a number is a power of 2.
Design an implement of the inputs functions for event mode
programming in c lanugaue programm will errror error with two header file one as stdio.h and other one is conio.h
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.
19 Answers Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,
Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print
how to return a multiple value from a function?
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
main( ) { static int a[ ] = {0,1,2,3,4}; int *p[ ] = {a,a+1,a+2,a+3,a+4}; int **ptr = p; ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *ptr++; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); *++ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); ++*ptr; printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr); }
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
#define max 5 #define int arr1[max] main() { typedef char arr2[max]; arr1 list={0,1,2,3,4}; arr2 name="name"; printf("%d %s",list[0],name); }