C Programming - Declarations and Initializations - Discussion
Discussion Forum : Declarations and Initializations - General Questions (Q.No. 1)
1.
Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?
Answer: Option
Explanation:
fmod(x,y) - Calculates x modulo y, the remainder of x/y.
This function is the same as the modulus operator. But fmod() performs floating point divisions.
Example:
#include <stdio.h>
#include <math.h>
int main ()
{
printf ("fmod of 3.14/2.1 is %lf\n", fmod (3.14,2.1) );
return 0;
}
Output:
fmod of 3.14/2.1 is 1.040000
Discussion:
141 comments Page 11 of 15.
Sivaraman said:
1 decade ago
It's really not understand me, please briefly explain it for modf() and fmod().
Ajith said:
1 decade ago
What is REM?
Prtk15 said:
1 decade ago
There is a new data-type which can take as values natural numbers between (and including) 0 and 25. How many minimum bits are required to store this data-type?
What will be its answer? Can anybody help me?
What will be its answer? Can anybody help me?
Anjali said:
1 decade ago
What is return 0?
Md imran khan said:
1 decade ago
Why array index is always start with zero? Please reply any body?
Mani said:
1 decade ago
2)16(8
16
------------
0
Rem = 0.
16
------------
0
Rem = 0.
Trupti Patil said:
1 decade ago
Function written inside block is called local function & used only within that block. Function declared before main program starts below the header files is called global function.
Scope of local function is only within that part of the program it can not be access in other function.
Scope of local function is only within that part of the program it can not be access in other function.
Rajashekhar said:
1 decade ago
int main()? What's the function it is?
Shalivahana said:
1 decade ago
fmod() function or keyword is find used to find out.
Gayathridhiravidamani said:
1 decade ago
#include<stdio.h>
main()
{
float a=3.14,b=2.1,c;
c=a%b;
pf("%d",c);
output: invalid operand to binary%
BUT
int a;
a=3.14%2.1;
pf("%d",a);
Output 1:
I think so, comma act as a operator. Please clear explanation.
main()
{
float a=3.14,b=2.1,c;
c=a%b;
pf("%d",c);
output: invalid operand to binary%
BUT
int a;
a=3.14%2.1;
pf("%d",a);
Output 1:
I think so, comma act as a operator. Please clear explanation.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers