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

main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user

2 Answers   HCL,


main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }

1 Answers  


main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }

1 Answers   TCS,


3) Int Matrix of certain size was given, We had few valu= es in it like this. =97=97=97=97=97=97=97=97=97=97=97 1 = | 4 | | 5 | &= nbsp; | 45 =97=97=97=97=97=97=97=97=97=97=97 &n= bsp; | 3 | 3 | 5 | = | 4 =97=97=97=97=97=97=97=97=97=97=97 34 |&nbs= p; 3 | 3 | | 12 | &= nbsp; =97=97=97=97=97=97=97=97=97=97=97 3 | &nbs= p; | 3 | 4 | = | 3 =97=97=97=97=97=97=97=97=97=97=97 3 | = ; | | | = ; 3 | =97=97=97=97=97=97=97=97=97=97=97 &= nbsp; | | 4 | = ; | 4 | 3 We w= ere supposed to move back all the spaces in it at the end. Note: = If implemented this prog using recursion, would get higher preference.

0 Answers   RoboSoft,


main() { 41printf("%p",main); }8

1 Answers  






void main() { char ch; for(ch=0;ch<=127;ch++) printf(“%c %d \n“, ch, ch); }

1 Answers  


main() { char not; not=!2; printf("%d",not); }

1 Answers  


Write a program that reads a dynamic array of 40 integers and displays only even integers

2 Answers  


char inputString[100] = {0}; To get string input from the keyboard which one of the following is better? 1) gets(inputString) 2) fgets(inputString, sizeof(inputString), fp)

1 Answers  


Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

1 Answers  


main() { char *p = "hello world"; p[0] = 'H'; printf("%s", p); } a. Runtime error. b. “Hello world” c. Compile error d. “hello world”

5 Answers   HCL,


main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }

1 Answers  


Categories