Calculate lenth of a string without using Library Function
#include<stdio.h>
#include<conio.h>
void main()
{
char a[]="ram";
int i,c=0;
for(i=0;a[i]!=NULL;i++)
{
c++;
}
printf("lenth of the string is %d",c);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
char a[]="ram";
int i,c=0;
for(i=0;a[i]!=NULL;i++)
{
c++;
}
printf("lenth of the string is %d",c);
getch();
}
No comments:
Post a Comment