strlen

 #include <stdio.h>

#include <string.h>


int main() {

    // Write C code here

   //char str[]="Sayan Bhai";

   char *str = "Sayan Bhai";

   str="hello bhai";

   puts(str);

   int a = strlen(str);//will calculate lenght excluding '\0', null char

   printf("Lenght of string is %d",a);

    

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings