Write a c program to calculate the length of the string without using standard function

#include<stdio.h>
#include<conio.h>
void main()
{
int i=0,cnt=0;
char str[50];
clrscr();
printf("\n Enter the string=");
gets(str);
while(str[i]!=NULL)
{
i++;
}
printf("\n string length=%d",i);
getch();
}

Comments

  1. it was a nice code k n any one send me few basic (simple) programs question so tat i can try to code them my self at my email id praveen.gkh@gmail.com thanku

    ReplyDelete
  2. and how to put space(s _a _m ) btw each char of a string name

    ReplyDelete

Post a Comment