All variables must be declared before they are used in the program. State whether the statement is True (or) False And Justify it
Answers
Answered by
4
Hi,
Answer:
➖➖➖
YES ,All variables must be declared before they are used in the program.
Explanation:
➖➖➖➖
Whenever we write code for any program all the variable must declare before used,otherwise an error shows that unknown is present.
For example:
✳️Declaration of variables:
Data_type Identifier1, identifier 2;
eg:
✳️int Sum,P, R;
Sum = P+R;
here Sum ,P and R holds the integer value.
Sum can be 5,10 21 etc,according to the other variables P and Q.
✳️Float S;
here S holds floating point values.
Here S = 2.5 etc
Hope it helps you.
Answer:
➖➖➖
YES ,All variables must be declared before they are used in the program.
Explanation:
➖➖➖➖
Whenever we write code for any program all the variable must declare before used,otherwise an error shows that unknown is present.
For example:
✳️Declaration of variables:
Data_type Identifier1, identifier 2;
eg:
✳️int Sum,P, R;
Sum = P+R;
here Sum ,P and R holds the integer value.
Sum can be 5,10 21 etc,according to the other variables P and Q.
✳️Float S;
here S holds floating point values.
Here S = 2.5 etc
Hope it helps you.
Answered by
3
Yes, all variables must be declared before they are used in the program.
The variables are used in the programming language that helps in the execution of the program further.
Hence, in order to easily call the variable in the program, it is essential to pre-define in the initial steps so that the program is running steadily.
Similar questions