Program to find the length of a string in C, CPP, C Plus Plus with the flowchart
In this tutorial, we will answer the following questions;
- Flowchart of a program to find the length of a string.
- Program to find the length of a string in C Plus Plus.
- Program to find the length of a string in C.
Flowchart of a program to find the length of a string

Program to find the length of a string in C Plus Plus
#include<iostream>
#include<stdio.h>
#include<conio.h>
#include<string.h>
using namespace std;
int main()
{
char str[86];
int length;
cout<<"Please Enter String: ";
gets(str);
length = strlen(str);
cout<<"Please String Length: "<<length;
return 0;
}
Output

Program to find the length of a string in C
#include<stdio.h>
#include<conio.h>
#include<string.h>
int main()
{
char str[86];
int length;
printf("Please Enter String: ");
gets(str);
length = strlen(str);
printf("String Lengthis= %d",length);
return 0;
}
Output

Figure: Output of program for finding the string length.