#include<stdio.h> int main() { printf("%f\n", log(36.0)); return 0; }
Declaration syntax: double log(double);
Example:
#include <stdio.h>
#include <math.h>
int main ()
{
printf ("fmod of 5.5 by 1.3 is %lf\n", fmod (5.5, 1.3) );
return 0;
}
Output:
fmod of 5.5 by 1.3 is 0.300000
y = (int)(x + 0.5); here x is any float value. To roundoff, we have to typecast the value of x by using (int)
Example:
#include <stdio.h>
int main ()
{
float x = 3.6;
int y = (int)(x + 0.5);
printf ("Result = %d\n", y );
return 0;
}
Output:
Result = 4.
char *arr[10];
int (*pf)();
char *ptr[3]();
char *ptr[3];
char (*ptr[3])();
char **ptr[3];
char *ptr[3];
int *f();
float *(ptr)*int;
float *(*ptr)(int)
float *(*ptr)(int*)
float (*ptr)(int)
float *(*ptr)(int*)
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.