Write A Program to find length of a string with out using string handling functions

#include<stdio.h> #include<conio.h> int len ( char s [ ]); void main ( ) { char s [20]; int l; clrscr(); print...

#include<stdio.h>
#include<conio.h>
int len ( char s [ ]);
void main ( )
{
char s [20];
int l;
clrscr();
printf (“enter a string”);
gets ( s);
l = len ( s);
printf ( “\n length is %d”,l);
getch();
}

int len ( char s[])
{
int c = o, i;
for ( i =0; s[i]!='\0'; i++)
{
  c++;
}
return ( c);
}

Related

C Programs 5393480498701371941

Post a Comment

emo-but-icon

item