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

CodeTextPro.com Provides - Web design, Technology gyan, Digital marketing, Online earnings, Seo, Adsense, Technology news, Motivation and inspiration, Latest Technology Affairs, Gadgets, Blogging

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