Created
September 16, 2014 14:50
-
-
Save metrafonic/719f1fda708f58a1beb1 to your computer and use it in GitHub Desktop.
C Programming Variables
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
int main(){ | |
float poop; | |
int oct; | |
oct =0x1067; | |
printf("Demo Integers:\n"); | |
printf("Using: 0x1067\n"); | |
printf("As integer: %i\n", oct); | |
printf("As oct: %o\n", oct); | |
printf("As hex: %#x\n", oct); | |
printf("As hex without leading 0: %x\n", oct); | |
poop=0.00532; | |
printf("\n\nDemo Floats:\n"); | |
printf("Using 0.00532\n"); | |
printf("As float: %f\n", poop); | |
printf("As scientific notation: %e", poop); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment