What will be the output of the following C++ code? [code] #include <iostream> #include <string> using namespace std;

Ánh Dương

New member
What will be the output of the following C++ code?
Code:
    #include <iostream>
    #include <string>
    using namespace std;
    int main ()
    {
        string str ("Microsoft");
        for (size_t i = 0; i < str.length();)
        {
            cout << str.at(i-1);
        }
        return 0;
    }
A. M
B. Microsoft
C. Micro
D. runtime error
 

Tìm kiếm

Back
Top