What will be output of following program?
#include<stdio.h>
#include<string.h>
int main(){
int register a;
scanf("%d",&a);
printf("%d",a);
return 0;
}
//if a=25
(A) 25
(B) Address
(C) 0
(D) Compilation error
(E) None of above
________________________________________
Explanation:
Turbo C++ 3.0: Compilation error
Turbo C ++4.5: Compilation error
Linux GCC: Compilation error
Visual C++: Compilation error
Register data type stores in CPU. So it has not any memory address. Hence we cannot write &a.
No comments:
Post a Comment