Skip to main content

Program to Find Length of String in CPP

· One min read
Kaustubh Kulkarni
file.cpp
#include<iostream>
using namespace std;
int main()
{
char str[20];
cout<<"Enter String :";
cin>>str;
int count=0;
for(int i=0;str[i]!='';i++)
{
count++;
}
cout<<count;
}