Using the Basic Data Types, and output their values, int, float, double, char, _Bool - C Data Type

C examples for Data Type:Introduction

Description

Using the Basic Data Types, and output their values, int, float, double, char, _Bool

Demo Code

#include <stdio.h>

int main(void)
{
   int     integerVar = 100;
   float   floatingVar = 123.79;
   double  doubleVar = 1.23e+11;
   char    charVar = 'W';


   printf("integerVar = %i\n", integerVar);
   printf("floatingVar = %f\n", floatingVar);
   printf("doubleVar = %e\n", doubleVar);
   printf("doubleVar = %g\n", doubleVar);
   printf("charVar = %c\n", charVar);


   return 0;/* w w  w . java  2 s .c o  m*/
}

Result


Related Tutorials