Write a c program to find out the length of the string - CodeTextPro | Free Web Tutorial

Codetextpro Provides free Web tutorial, HTML, CSS, C, C++, Java, JavaScript, PHP, MySql, Python, Program, Programming Notes, Programming Questions and more.

Programming

Sunday, January 6, 2019

Write a c program to find out the length of the string

Find out the length of the string

#include<stdio.h>
#include<conio.h>
#include<string.h>
main()
{
char str[100],i=0,length;
printf("please enter the string\n");
gets(str);
while(str[i]!='\0')
{
i++;
length=i;
}
printf("\n the length of string is %d",length);
getch();
}

No comments:

Post a Comment