Q. What is the correct syntax to declare a variable in C?

  • (A) data_type variable_name;
  • (B) data_type as variable_name;
  • (C) variable_name data_type;
  • (D) variable_name as data_type;
πŸ’¬ Discuss
βœ… Correct Answer: (A) data_type variable_name;
Explanation: In C language, the correct syntax to declare a variable is:

data_type variable_name;

Where, data_type is the type of data (such as int, char, float, etc) and variable_name is a valid identifier. For example: int age;
Explanation by: Kanak Sharma
In C language, the correct syntax to declare a variable is:

data_type variable_name;

Where, data_type is the type of data (such as int, char, float, etc) and variable_name is a valid identifier. For example: int age;

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
347
Total Visits
πŸ“½οΈ
3 y ago
Published
πŸŽ–οΈ
Kanak Sharma
Publisher
πŸ“ˆ
86%
Success Rate