PRACTICAL-SET-5
2. Find length of string using strlen( ) function
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i;
char str[30];
clrscr();
printf("Enter the string:");
scanf("%s",&str);
i = strlen(str);
printf("Length of the entered string: %d",i);
getch();
}
OUTPUT:
2. Find length of string using strlen( ) function
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i;
char str[30];
clrscr();
printf("Enter the string:");
scanf("%s",&str);
i = strlen(str);
printf("Length of the entered string: %d",i);
getch();
}
OUTPUT:
String Length |
No comments:
Post a Comment