Skip to content

Instantly share code, notes, and snippets.

Created April 9, 2017 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/e147efa6ce107b9964b8c653067a4970 to your computer and use it in GitHub Desktop.
Save anonymous/e147efa6ce107b9964b8c653067a4970 to your computer and use it in GitHub Desktop.
/*An example C program to demonstrate different data types.*/
#include <stdio.h>
int main()
{
int meaningOfLife = 42;
float a_random_float = 56.9;
double pi = 3.141;
char c = 'c';
printf("\nThe integer meaningOfLife holds the value: %d and it's size is: %d", meaningOfLife, sizeof(meaningOfLife));
printf("\nThe float a_random_float holds the value: %f and it's size is: %d", a_random_float, sizeof(a_random_float));
printf("\nThe double pi holds the value: %lf and it's size is: %d", pi, sizeof(pi));
printf("\nThe character c holds the value: %c and it's size is: %d", c, sizeof(c));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment