More Programs On Strings

Write a program to calculate lenght of a given string in C language

By September 18, 2012 September 5th, 2018 No Comments
  1. #include<stdio.h>
  2. #include<conio.h>
  3. #include<string.h>
  4. main()
  5. {
  6. char *s1;
  7. clrscr();
  8. printf("Enter string : ");
  9. scanf("%s",s1);
  10. printf("Lenght: %d",strlen(s1));
  11. getch();
  12. }
#include<stdio.h>
#include<conio.h>  
#include<string.h>
main()
{
	char *s1;
	clrscr();
	printf("Enter string : ");
	scanf("%s",s1);
	printf("Lenght: %d",strlen(s1));
	getch();
}
Watch video explaination

Leave a Reply

DEMO01