int i=10;
main()
{
extern int i;
{
int i=20;
{
const volatile unsigned i=30;
printf("%d",i);
}
printf("%d",i);
}
printf("%d",i);
}
Answer / susie
Answer :
30,20,10
Explanation:
'{' introduces new block and thus new scope. In the
innermost block i is declared as,
const volatile unsigned
which is a valid declaration. i is assumed of type int. So
printf prints 30. In the next block, i has value 20 and so
printf prints 20. In the outermost block, i is declared as
extern, so no storage space is allocated for it. After
compilation is over the linker resolves it to global
variable i (since it is the only variable visible there). So
it prints i's value as 10.
| Is This Answer Correct ? | 6 Yes | 8 No |
There were 10 records stored in “somefile.dat” but the following program printed 11 names. What went wrong? void main() { struct student { char name[30], rollno[6]; }stud; FILE *fp = fopen(“somefile.dat”,”r”); while(!feof(fp)) { fread(&stud, sizeof(stud), 1 , fp); puts(stud.name); } }
Write a program that find and print how many odd numbers in a binary tree
what is brs test reply me email me kashifabbas514@gmail.com
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
What is the subtle error in the following code segment? void fun(int n, int arr[]) { int *p=0; int i=0; while(i++<n) p = &arr[i]; *p = 0; }
prog. to produce 1 2 3 4 5 6 7 8 9 10
how to swap 3 nos without using temporary variable
How to access command-line arguments?
What is the match merge ? compare data step match merge with proc sql merge - how many types are there ? data step vs proc sql
program to find magic aquare using array
main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
Finding a number multiplication of 8 with out using arithmetic operator