What is a keyword?
Keywords are the reserved word’s in a programming language. These are predefined in a programming language and has different mean for the compiler. These keywords can’t be used as a user-defined program identifier.
List of keyword defined in the c language
auto | double | int | struct |
break | else | long | switch |
case | enum | register | typedef |
char | extern | return | union |
continue | for | signed | void |
do | if | static | while |
default | goto | sizeof | volatile |
const | float | short | unsigned |
Example : #include <stdio.h> int main() { int a; double x; return 0; }
What is Data Type?
- Data types are used to define the variable and function in a program to store the value of different sizes or types.
- The data type is useful to save memory space.
- We have different datatype to store the different sizes of data.
List of dataTypes with respect to their sizes
Type | Size (bytes) | Format Specifier |
int | at least 2, usually 4 | %d, %i |
char | 1 | %c |
float | 4 | %f |
double | 8 | %lf |
short int | 2 usually | %hd |
unsigned int | at least 2, usually 4 | %u |
long int | at least 4, usually 8 | %ld, %li |
long long int | at least 8 | %lld, %lli |
unsigned long int | at least 4 | %lu |
unsigned long long int | at least 8 | %llu |
signed char | 1 | %c |
unsigned char | 1 | %c |
long do0 Comments in moderationuble | at least 10, usually 12 or 16 | %Lf |
Example: #include <stdio.h> int main() { int a; printf("size of int= %d bytes\n", sizeof(a)); return 0; }