Q:

Write a c program to input a string and find it’s length without using library function

0

Write a c program to input a string and find it’s length without using library function

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
	char a[15];
	int i,l=0;
	printf("\n enter the string :");
	scanf("%s",a);
	for(i=0;a[i]!='\0';i++)
	l++;
	printf("\n length=%d",l);
getch ();
}

Output:

enter the string :ae ryan

length=5

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Programming Exercises With Solutions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
write a c program to check whether the enter strin... >>
<< Write a c program to find transpose of matrix...