What is the output of the program if characters ‘t’, ‘e’, ‘s’ and ‘t’ enter are supplied as input?

What is the output of the program if characters ‘t’, ‘e’, ‘s’ and ‘t’ enter are supplied as input?

#include <iostream>

#include <string>

using namespace std;

int main()

{

string s;

getline( cin, s );

cout << s << " " << s.length();

return (0);

}
A . It prints: test 4
B . It prints: test
C . It prints: test 5
D . It prints: 4

Answer: A

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments