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 a single line c expression to delete a,b,c from aabbcc
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }
main() { int c = 5; printf("%d", main||c); } a. 1 b. 5 c. 0 d. none of the above
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d..%d",*p,*q); }
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,
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
int a=1; printf("%d %d %d",a++,a++,a); need o/p in 'c' and what explanation too
main() { char s[ ]="man"; int i; for(i=0;s[ i ];i++) printf("\n%c%c%c%c",s[ i ],*(s+i),*(i+s),i[s]); }
Under linux environment can u please provide a c code for computing sum of series 1-2+3-4+5......n terms and -1+2-3+4-5...n terms..
How do you write a program which produces its own source code as its output?