1.
What will be output when you will execute following c code?
#include<stdio.h>
int main(){
printf("%d\t",sizeof(6.5));
printf("%d\t",sizeof(90000));
printf("%d",sizeof('A'));
return 0;
}
Choose all that apply:
Explanation:
Turbo C++ 3.0: 8 4 2
Turbo C ++4.5: 8 4 2
Linux GCC: 8 4 4
Visual C++: 8 4 4
By default data type of numeric constants is:
6.5 : double
90000: long int
‘A’: char
In C size of data type varies from compiler to compiler.
In TURBO C 3.0 (16 bit compilers) size of:
double is 8 byte
Long int is 4 byte
Character constant is 2 byte (size of char data type is one byte)
In TURBO C 4.5 or Linux GCC compilers (32 bit compilers) size of:
double is 8 byte
long int is 8 byte
Character constant is 2 byte
20.
Consider on following declaration in c:
(i)short const register i=10;
(ii)static volatile const int i=10;
(iii)unsigned auto long register i=10;
(iv)signed extern float i=10.0;
Choose correct one:
No comments:
Post a Comment