Computes the length of a line
#include <string.h>
#include <stdio.h>
int main()
{
char line[100];
printf("Enter a line: ");
fgets(line, sizeof(line), stdin);
printf("The length of the line is: %d\n", strlen(line));
return (0);
}
Related examples in the same category