Skip to content

Instantly share code, notes, and snippets.

@Manume
Last active August 29, 2015 14:01
Show Gist options
  • Save Manume/ad200b7497a2ba66c4df to your computer and use it in GitHub Desktop.
Save Manume/ad200b7497a2ba66c4df to your computer and use it in GitHub Desktop.
program to find the length of string
#include <iostream.h>
#include <conio.h>
#include <string.h>
void main()
{
clrscr();
int slength;
char x[81]; //Allowing the user to input a maximum of 80 characters.
cout << "Enter the string : " << endl;
cin>>x;
slength=strlen(x);
cout << "The length of the string " << x << " is " << slength << "." << endl;
getch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment