πŸ“Š C++
Q. Which of the following is the correct syntax to declare a static variable in C++?
  • (A) int static a;
  • (B) static int a;
  • (C) static a int;
  • (D) int a static;
πŸ’¬ Discuss
βœ… Correct Answer: (B) static int a;

Explanation: In C++, a static variable is declared using the 'static' keyword followed by the data type, like 'static int a;'.

Explanation by: Gopal Sharma
In C++, a static variable is declared using the 'static' keyword followed by the data type, like 'static int a;'.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
109
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Gopal Sharma
Publisher
πŸ“ˆ
93%
Success Rate