c int to double code example
Example 1: type change in c
#include <stdio.h>
main() {
int sum = 17, count = 5;
double mean;
mean = (double) sum / count;
printf("Value of mean : %f\n", mean );
}
Example 2: How to Convert double to int in C
double a = 12.34;
int b = a ;
//b = 12 not 12.34
Example 3: int to double c
int vIn = 0;
double vOut = (double)vIn;