1// First declaring and then initializing
2int a;
3int a = 5;
4// Declaring and initializing at one time
5int b = 6;
6
7// Basically used datatypes
8// 1. int // integer
9int num = 2;
10// 2. float // decimal number
11float number = 234.87;
12// 3. char // character
13char ch = 'p';
14// 4. char[] // string
15char name[] = {'B','i', 'l','l'}
16 // or
17char fav_fruit[] = "apple"
1int age; //int variableName; or int variableName = Value;
2 //Integers are whole numbers: 2, 23. They are NOT: 28.4, 8.07.
3char first_initial; //char variableName; or char variableName = 'Character';
4 //Characters are single characters on the keyboard. Numbers can
5 //be characters but they are best not stored as such
6char name[10]; //char stringName[size] or char stringName[size] = "String"
7 //Strings are defined as an array of characters that end
8 //w/a special character ‘\0’.
9float salary; //float variableName; or float variableName = value;
10 //Floats are numbers that contain up to seven digits including decimals.
11double micro; //double variableName; or double variableName = value;
12 //Doubles are more precise than floats and can hold more numbers.
13