C Program to initialize different datatypes and print the same on terminal

In this program we initialize different datatypes:

  1. Integer datatype to 10
  2. Floating point datatype to 3.141000
  3. Double precision datatype to 25156817.145550
  4. Character datatype to 'a'

Program

#include<stdio.h>
void main()
{
	int i;
	float f;
	double d;
	char ch;
	i = 10;
	printf("The value of integer data type is %d\n", i);
	f = 3.141;
	printf("The value of floating-point data type is %f\n", f);
	d = 25156817.14555;
	printf("The value of double precision data type is %lf\n", d);
	ch = 'a';
	printf("The value of character data type is '%c'\n", ch);
}

Output

The value of integer data type is 10
The value of floating-point data type is 3.141000
The value of double precision data type is 25156817.145550
The value of character data type is 'a'