Computer Science, asked by adeshbhullar8586, 1 year ago

Find length of string in c without using strlen and null

Answers

Answered by pawanpaudel100p9yooy
1

#include <stdio.h>

int main()

{

   char s[1000];

   int i;

   printf("Enter a string: ");

   scanf("%s", s);

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

   printf("Length of string: %d", i);

   return 0;

}


shardul1925: hlo bro
Similar questions