LogiQuest
Back to Objects and Classes
11

What will be the output of the program?

#include <iostream>
using namespace std;
class S {
public:
    static int twice(int v) { return 2 * v; }
};
int main() {
    cout << S::twice(8) << endl;
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.