Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C Programming
»
Floating Point Issues
Which statement will you add in the following program to work it correctly? #include
int main() { printf("%f\n", log(36.0)); return 0; }
#include
#include
#include
#include
Correct Answer:
#include
Explanation:
math.h
is a header file in the standard library of C programming language designed for basic mathematical operations.
Declaration syntax
:
double log(double);
← Previous Question
Next Question→
More Questions from
Floating Point Issues
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; }
What will be the output of the program? #include
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
#include
int main() { printf("%f\n", sqrt(36.0)); return 0; }
What will be the output of the program? #include
#include
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
#include
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
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
int main() { float fval=7.29; printf("%d\n", (int)fval); return 0; }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments