My Subject Blog

C Program to Find String Length

/*
Write a program to Find String Length without using inbuilt function. 
*/

#include <stdio.h>

int main(void) {
// your code goes here
char str[100];
int len;
printf("Enter the String :");
scanf("%s",str);
for(len=0;str[len]!='\0';len++)
{

}
printf("Length = %d",len);

return 0;
}

Comments

Most Visited Post

C Program to Find Largest Odd Number from Array

C Program for Runtime Memory Allocation for Table of Integers

Followers