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 #include
int main () { printf ("fmod of 3.14/2.1 is %lf\n", fmod (3.14,2.1) ); return0; }
Output: fmod of 3.14/2.1 is 1.040000
4.
Is there any difference between following declarations?
extern int fun(); declaration in C is to indicate the existence of a global function and it is defined externally to the current module or in another file.
int fun(); declaration in C is to indicate the existence of a function inside the current module or in the same file.
The keyword return is used to transfer control from a function back to the calling function.
Example:
#include int add(int, int); /* Function prototype */
int main() { int a = 4, b = 3, c; c = add(a, b); printf("c = %d\n", c); return0; } int add(int a, int b) { /* returns the value and control back to main() function */ return (a+b); }
No comments:
Post a Comment