πŸ“Š C++
Q. What is the output of this program?
Code:
#include 
    using namespace std;
    void Output()
    {
        static int p = 1;
        int k;
        for(k=p; k<=3; k++)
        {
        p++;
        cout << p;
        }
    }
    int main()
    {
        Output();
        Output();
        Output();
        return 0;
    }
  • (A) 0123
  • (B) 123
  • (C) 234
  • (D) 012345
πŸ’¬ Discuss
βœ… Correct Answer: (C) 234

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
236
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Rohan Raj
Publisher
πŸ“ˆ
84%
Success Rate