This is a simple Cpp Program to read and display the content of the string.
Download Code
PROGRAM :
#include <iostream> #include <string.h> using namespace std; int main() { char name[40]; cout << "Enter any name(String) : \t"; cin.get(name , 40); cout << "\nThe length of the string you entered is : \t" << strlen(name) << endl; return 0; }
OUTPUT :
Cpp Program - Reading and displaying a string |