You are on page 1of 1

/*PRE-REQUISITE LAB 3

Program for length of a string*/


#include <stdio.h>
int main() {
char s[] = "Programming is fun";
int i;

for (i = 0; s[i] != '\0'; ++i);


printf("Length of the string: %d", i);
return 0;
}

OUTPUT:
Length of the string: 18

You might also like