Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Floating Point Issues
What will you do to treat the constant 3.14 as a float?
use float(3.14f)
use 3.14f
use f(3.14)
use (f)(3.14)
Correct Answer:
use 3.14f
Explanation:
Given
3.14
is a
double
constant.
To specify
3.14
as
float
, we have to add
f
to the 3.14. (i.e
3.14f
)
← Previous Question
Next Question→
More Questions from
Floating Point Issues
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
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
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
int main() { float *p; printf("%d\n", sizeof(p)); return 0; }
What will be the output of the program? #include
int main() { float a=0.7; if(a < 0.7f) printf("C\n"); else printf("C++\n"); return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments