Computer Science, asked by jan13, 1 year ago

How to declare and initialize variable in C

Answers

Answered by samyakjain8430
2

Declaration of variable in c can be done using following syntax:

data_type variable_name;

or

data_type variable1, variable2,…,variablen;

where data_type is any valid c data type and variable_name is any valid identifier.

For example,

1

2

3

int a;

float variable;


singhprakashjnv: data_type variable name;
singhprakashjnv: variable_name=number according to data_type;
Answered by nandankpnair
1

Answer:In c programming language, variable can be initialized in the declaration statement of any block (either it may main's block or any other function's block). While declaring a variable you can provide a value to the variable with assignment operator.

Explanation:

Similar questions