Primary / Fundamental Data Types in C Language
There are 4 primary data types C Language provides
Data Type | Range of Values |
---|---|
char | -128 to 127 |
int | -32,768 to 32,767 |
float | 3.4e-38 to 3.4e+38 |
double | 1.7e-308 to 1.7e+308 |
Following is a sample program which uses these data Types
#include <stdio.h>
int main() {
char group = 'a';
int age = 23;
float temperature = 12.5;
double balance = 23234.3;
printf("Data Types and their values\n");
printf("group is: %c\n",group);
printf("age is: %d\n", age);
printf("temperature is: %f\n", temperature);
printf("balance is: %f", balance);
}
Output:
Data Types and their values
group is: a
age is: 23
temperature is: 12.500000
balance is: 23234.300000