Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Floating Point Issues Questions
If the binary eauivalent of 5.375 in normalised form is 0100 0000 1010 1100 0000 0000 0000 0000, what will be the output of the program (on intel machine)? #include<stdio.h> #include<math.h> int main() { float a=5.375; char *p; int i; p = (char*)&a; for(i=0; i<=3; i++) printf("%02x\n", (unsigned char)p[i]); return 0; }
What will you do to treat the constant 3.14 as a long double?
What will you do to treat the constant 3.14 as a float?
The binary equivalent of 5.375 is
We want to round off x, a float, to an int value, The correct way to do is
Which of the following statement obtains the remainder on dividing 5.5 by 1.3?
Which of the following range is a valid long double (Turbo C in 16 bit DOS OS)?
A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored?
Which statement will you add in the following program to work it correctly? #include<stdio.h> int main() { printf("%f\n", log(36.0)); return 0; }
What are the different types of real data type in C?
What will be the output of the program? #include<stdio.h> int main() { float d=2.25; printf("%e,", d); printf("%f,", d); printf("%g,", d); printf("%lf", d); return 0; }
What will be the output of the program? #include<stdio.h> int main() { float *p; printf("%d\n", sizeof(p)); return 0; }
What will be the output of the program? #include<stdio.h> int main() { float a=0.7; if(a < 0.7f) printf("C\n"); else printf("C++\n"); return 0; }
What will be the output of the program? #include<stdio.h> int main() { float a=0.7; if(a < 0.7) printf("C\n"); else printf("C++\n"); return 0; }
What will be the output of the program? #include<stdio.h> #include<math.h> int main() { printf("%f\n", sqrt(36.0)); return 0; }
What will be the output of the program? #include<stdio.h> #include<math.h> int main() { printf("%d, %d, %d\n", sizeof(3.14f), sizeof(3.14), sizeof(3.14l)); return 0; }
What will be the output of the program? #include<stdio.h> #include<math.h> int main() { float n=1.54; printf("%f, %f\n", ceil(n), floor(n)); return 0; }
What will be the output of the program? #include<stdio.h> int main() { float f=43.20; printf("%e, ", f); printf("%f, ", f); printf("%g", f); return 0; }
What will be the output of the program? #include<stdio.h> int main() { float fval=7.29; printf("%d\n", (int)fval); return 0; }