Get premium membership and access questions with answers, video lessons as well as revision papers.

Write a program that uses C++ style I/O to prompt the user for a string and then display its length.

      

Write a program that uses C++ style I/O to prompt the user for a string and then display its length.

  

Answers


Davis
#include
#include
using namespace std;
int main()
{
char s[80];
cout << "Enter a string : ";
cin >> s;
cout << "Length: " << strlen(s) << "\n";
return 0;
}
Githiari answered the question on May 5, 2018 at 17:39


Next: Given the following new-style C++ program, show how to change it into its old-style form.#include using namespace std;into f(into a);into main(){cout << f(10);return 0;}int f(int...
Previous: Create a class in C++ language that holds name and address information.Store all the information in character strings that are private members of the class.Include...

View More Computer Science Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions