What will be the output of the following C++ code?
A. M
B. Microsoft
C. Micro
D. runtime error
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;
}
B. Microsoft
C. Micro
D. runtime error