Created
April 9, 2017 16:10
-
-
Save anonymous/e147efa6ce107b9964b8c653067a4970 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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