What would be the best description of the following codes
What would be the best description of the following codes?
char s[21];
cin >> s;
strcat(s, "!");
cout << s;
cout << s;
t declares a regular C++ null-terminated string that
holds up to 20 characters, reads user input into the string, appends an exclamation point to the end of the string, and prints the result.
It declares a regular C++ 20 characters array, reads a character input from an user into the array, appends an exclamation point to the last position of the array, and prints the result.
It declares a regular C++ null-terminated string that
holds up to 20 characters, reads user input into the string, appends an exclamation point to the last postion of the string, and prints the result.
It declares a regular C++ 20 characters array, reads a character input from an user into the array, appends an
exclamation point to the 2nd position of the array, and prints the result.
It declares a regular C++ 20 characters array, reads couple character input from an user into the array, appends an exclamation point to the 21st position of the array, and prints the result.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps