int myNum = 5;
float myFloatNum = 5.99; // floating point number
char myLetter = 'D'; // string
// print output variables
printf("%d\n", myNum);
printf("%f\n", myFloatNum);
printf("%c\n", myLetter);
Data Types
// create variables
int myNum = 5; // integer
float myFloatNum = 5.99; // floating point number
char myLetter = 'D'; // string
// High precision floating point data or numbers
double myDouble = 3.2325467;
// print output variables
printf("%d\n", myNum);
printf("%f\n", myFloatNum);
printf("%c\n", myLetter);
printf("%lf\n", myDouble);
Data Type | Description |
---|---|
char |
character type |
short |
short integer |
int |
integer type |
long |
long integer |
float |
single-precision floating-point type |
double |
double-precision floating-point type |
void |
no type |
Comments