Trusted by millions of Kenyans
Study resources on Kenyaplex

Get ready-made curriculum aligned revision materials

Exam papers, notes, holiday assignments and topical questions – all aligned to the Kenyan curriculum.

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

Answer Attachments

Exams With Marking Schemes

Related Questions