Floating Point Issues

Q1:
What will be the output of the program?
#include<stdio.h>
int main()
{
    float *p;
    printf("%d\n", sizeof(p));
    return 0;
}

A 2 in 16bit compiler, 4 in 32bit compiler

B 4 in 16bit compiler, 2 in 32bit compiler

C 4 in 16bit compiler, 4 in 32bit compiler

D 2 in 16bit compiler, 2 in 32bit compiler

ANS:A - 2 in 16bit compiler, 4 in 32bit compiler

sizeof(x) returns the size of x in bytes.
float *p is a pointer to a float. In 16 bit compiler, the pointer size is always 2 bytes.
In 32 bit compiler, the pointer size is always 4 bytes.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.