Thursday, September 27, 2018

string.h - Finding out string length

#include<string.h>
#include<iostream>
using namespace std;
// Program to find out length of a string

main()
{
char str[100];
cout<<"Enter a String ";
cin.getline(str,100);

cout<<str;
int i=strlen(str);

cout<<"\n Total Number of characters in the string = " <<i;
}

No comments:

Post a Comment