-
What is the output of this program?
#include <iostream>
#include <string>
using namespace std;
int main ()
{
string s ("Interview Mania");
for (size_t k = 0; k < s.length();)
{
cout << s.at(k-1);
}
return 0;
}
-
- Interview
- Mania
- Interview Mania
- Compilation Error
- Runtime Error
Correct Option: E
terminate called after throwing an instance of 'std::out_of_range'
what(): basic_string::at: __n (which is 18446744073709551615) >= this->size() (which is 15)
timeout: the monitored command dumped core
sh: line 1: 24994 Aborted timeout 10s main