C Programming - Floating Point Issues - Discussion
Discussion Forum : Floating Point Issues - General Questions (Q.No. 5)
5.
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;
}
Answer: Option
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);
Discussion:
14 comments Page 2 of 2.
Mallikarjun said:
1 decade ago
float 3.12;
{
scanf("2.1%f",&a);
}
Output? And in this program what is 2.1%f?
Please explain who know about this?
{
scanf("2.1%f",&a);
}
Output? And in this program what is 2.1%f?
Please explain who know about this?
Muhammed shafeek kp said:
9 years ago
#include<stdio.h>
int main()
{
printf("%f\n", log(36.0));
return 0;
}
What is the output of this program?
Can I run this program by using #include<conio.h>?
int main()
{
printf("%f\n", log(36.0));
return 0;
}
What is the output of this program?
Can I run this program by using #include<conio.h>?
Rajat Bhise said:
7 years ago
@Satti.
#include<stdio.h>
main()
{
int a,b,c;
a=32767;
b=32768;
c=32769;
printf("a=%d,b=%d,c=%d",a,b,c);
}
Output is
a=32767
b=-32768
c=-32769 this type of output is in book
But;
My output is;
a=32767
b=32768
c=32769
The '-' minus sign is not find how? Please explain this.
#include<stdio.h>
main()
{
int a,b,c;
a=32767;
b=32768;
c=32769;
printf("a=%d,b=%d,c=%d",a,b,c);
}
Output is
a=32767
b=-32768
c=-32769 this type of output is in book
But;
My output is;
a=32767
b=32768
c=32769
The '-' minus sign is not find how? Please explain this.
Aadhiii said:
6 years ago
@Satti.
#include<stdio.h>
main()
{
int a,b,c;
a=32767;
b=32768;
c=32769;
printf("a=%d,b=%d,c=%d",a,b,c);
}
Output is
a=32767
b=-32768
c=-32769 this type of output is in book
But;
My output is;
a=32767
b=32768
c=32769
The '-' minus sign is not find how? Please explain this.
#include<stdio.h>
main()
{
int a,b,c;
a=32767;
b=32768;
c=32769;
printf("a=%d,b=%d,c=%d",a,b,c);
}
Output is
a=32767
b=-32768
c=-32769 this type of output is in book
But;
My output is;
a=32767
b=32768
c=32769
The '-' minus sign is not find how? Please explain this.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers