when to define a variable in c? code example
Example 1: declare variable in c
int i, j, k;
char c, ch;
float f, salary;
double d;
Example 2: declaring variables in c
// First declaring and then initializing
int a;
int a = 5;
// Declaring and initializing at one time
int b = 6;
// Basically used datatypes
// 1. int // integer
int num = 2;
// 2. float // decimal number
float number = 234.87;
// 3. char // character
char ch = 'p';
// 4. char[] // string
char name[] = {'B','i', 'l','l'}
// or
char fav_fruit[] = "apple"