Skip to main content

Featured

functions in Python

C++ program to calculate length of a string


//C++ program to calculate the length of the string
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main()
{
clrscr();
int i;
char string[20];
cout<<"Enter A String\n";
gets(string);
for(i=0;string[i]!='\0';i++);
cout<<"The length of the string is"<<i;
getch();
}

Output:


Comments

Popular Posts