#include <string.h>
#include <stdio.h>

char line[100];

main()
{
    (void)printf("Enter a line: ");
    (void)fgets(line, sizeof(line), stdin);

    (void)printf("The length of the line is: %d\n", strlen(line));
    return (0);
}


syntax highlighted by Code2HTML, v. 0.9.1