Oct 4, 2011

C Program to Illustrate all data types.

C Program to Illustrate all data types.  The four different data types are assigned the corresponding values are printed. We can see that, to print a Integer value we give a %d sign, similarly for Character %c, Float %f and for Double %e.Read more about C Programming Language .

/***********************************************************
* You can use all the programs on  www.c-program-example.com
* for personal and learning purposes. For permissions to use the
* programs for commercial purposes,
* contact info@c-program-example.com
* To find more C programs, do visit www.c-program-example.com
* and browse!
* 
*                                  Happy Coding
***********************************************************/

/* */
# include <stdio.h>

int main()
{
 int   sum;
 float money;
 char  letter;
 double pi;

 sum = 10;   /* assign integer value*/
 money = 2.21; /* assign float value*/
 letter = 'A'; /* assign character value */
 pi = 2.01E6;  /* assign a double value */

 printf("value of sum = %d\n", sum );
 printf("value of money = %f\n", money );
 printf("value of letter = %c\n", letter );
 printf("value of pi = %e\n", pi );
 getchar();
 return (0);
}
Read more Similar C Programs
Learn C Programming

Number System
You can easily select the code by double clicking on the code area above.

To get regular updates on new C programs, you can

You can discuss these programs on our Facebook Page. Start a discussion right now,

our page!

Share this program with your Facebook friends now! by liking it


(you can send this program to your friend using this button)

Like to get updates right inside your feed reader? Grab our feed!