How to write a Program to find length of a string in C++ Programming ?
C++ Program to Find Length of a String |
Solution:
//Program to find length of a string.
#include<conio.h>
#include<iostream.h>
#include<stdio.h>
void main()
{
clrscr();
char a[80];
cout<<"Enter a string: ";
gets(a);
for(int i=0;a[i]!='\0';i++);
cout<<"The length of the string is: "<<i;
getch();
}
This C++ Program to Find Length of a String.