main()

{

int i;

float *pf;

pf = (float *)&i;

*pf = 100.00;

printf("\n %d", i);

}

a. Runtime error.

b. 100

c. Some Integer not 100

d. None of the above

Answers were Sorted based on User's Feedback



main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf(&qu..

Answer / pavan mustyala

d) Some junk number because floating value is stored in
integer via pointer pf.

Is This Answer Correct ?    15 Yes 1 No

main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf(&qu..

Answer / guest

d) 0

Is This Answer Correct ?    8 Yes 2 No

Post New Answer

More C Code Interview Questions

int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }

1 Answers  


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

0 Answers   Nagarro,


Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)

7 Answers   Microsoft,


All the combinations of prime numbers whose sum gives 32

1 Answers   HHH,


main() { int i; clrscr(); printf("%d", &i)+1; scanf("%d", i)-1; } a. Runtime error. b. Runtime error. Access violation. c. Compile error. Illegal syntax d. None of the above

1 Answers   HCL,


void main() { int i=10, j=2; int *ip= &i, *jp = &j; int k = *ip/*jp; printf(“%d”,k); }

1 Answers  


print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,


How will u find whether a linked list has a loop or not?

8 Answers   Microsoft,


write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30

0 Answers  


Link list in reverse order.

8 Answers   NetApp,


Derive expression for converting RGB color parameters to HSV values

1 Answers  


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers  


Categories