30. Find and display string length without using string function.


Comments

  1. #include
    #include
    void main()
    {
    char str[100];
    int i=0;
    printf("enter a string=\n");
    gets(str);
    while (str[i]!=NULL)
    {
    i++;
    }
    printf("length of string=%d\n",i);
    }

    ReplyDelete
  2. #include
    #include
    void main()
    {
    int i=0;
    char str[20]={"krishna sontakke"};
    printf(" %s \n",str);
    while (str[i]!=NULL)
    {
    i++;
    }
    printf("\n Length of string=%d \t",i);
    }

    ReplyDelete
  3. Pandhare Dipali11:33 AM

    /*count total lengh of string */
    #include
    #include
    void main()
    {
    char str[10];
    int i=0;
    printf("\n\t Enter the string");
    gets(str);
    while(str[i]!=NULL)
    {
    i++;
    }
    printf("\n\t lengh of string=%d",i);
    }

    ReplyDelete
  4. poonam pusavale11:39 AM

    /*count length of string*/
    #include
    #include
    void main()
    {
    char str[10];
    int i=0;
    printf("\n\t enter length of string");
    gets(str);
    while(str[i]!=NULL)
    {
    i++;
    }
    printf("\n\t length of string=%d",i);
    }

    ReplyDelete
  5. Swati Waghmare11:47 AM

    /*Count the length of string*/
    #include
    #include
    void main()
    {
    char str[10];
    int i=0;
    printf("\n\t Enter the string");
    gets(str);
    while(str[i]!=NULL)
    {
    i++;
    }
    printf("\n\tlength of string=%d",i);
    }

    ReplyDelete
  6. sonali nagane11:55 AM

    #include
    #include
    void main()
    {
    char str[5];
    int i=0;
    printf("\n enter the string");
    gets(str);
    while(str[i]!=NULL)
    {
    i++;
    }
    printf("\n lenght=%d",i);
    }

    ReplyDelete
  7. yogesh mane11:57 AM

    #include
    #include
    void main()
    {
    char s[10];
    int i=0;
    printf("\n\tt enter a string ");
    gets(s);
    while(s[i]!=NULL)
    {
    i++;
    }
    printf("length of string=%d",i);
    }

    ReplyDelete
  8. sayali daunde12:02 PM

    //length of string without using string function
    #include

    #include
    void main()
    {
    char str[100];
    int i=0;
    printf("enter a string=\n");
    gets(str);
    while (str[i]!=NULL)
    {
    i++;
    }
    printf("length of string=%d\n",i);
    }

    ReplyDelete
  9. Dipali Kore12:07 PM

    /*count total lengh of string */
    #include
    #include
    void main()
    {
    char str[10];
    int i=0;
    printf("\n\t Enter the string");
    gets(str);
    while(str[i]!=NULL)
    {
    i++;
    }
    printf("\n\t lengh of string=%d",i);
    }

    ReplyDelete
  10. Bhanvase Yashoda12:23 PM

    /*Length of string*/
    #include
    #include
    #include
    void main()
    {
    char str[7];
    int i;
    printf("\n\t enter string");
    gets(str);

    while(str[i]!=NULL)
    {

    i++;
    }
    printf("length of str=%d",i);







    }

    ReplyDelete
  11. Bhosale Dhanashri SE310:23 AM

    #include
    #include
    void main()
    {

    char str[50];
    int i=0;
    printf("\n\t Enter the string");
    scanf("%s",str);
    while(str[i]!=NULL)
    {
    i++;
    }
    printf("\n\t Length of String=%d",i);

    }




    ReplyDelete
  12. mubin pirjade10:56 AM

    /* PROGRAM TO CALCULATE LENGTH OF STRING */
    # include
    # include
    void main( )
    {
    int i=0;
    char str[20];
    printf("\n Enter a string:");
    scanf("%s",str); // Accepting string from the user.
    while (str[i]!=NULL) // Checking till the end of string i.e. NULL.
    {
    i++; // i++ s will count string length
    }
    printf("\String length is =%d",i);
    }

    ReplyDelete
  13. sachita jadhav11:17 AM

    /* length of string */
    #include
    #include
    #include
    void main()
    {
    char str[10];
    int i=0;`
    printf("enter string");
    gets(str);
    while(str[i]!=NULL)
    {
    i++;
    }
    printf("length of string=%d",i);

    }

    ReplyDelete
  14. Awate Snehal11:56 AM

    /*Lenth of string*/
    #include
    #include
    void main()
    {
    int i=0;
    char str[8];
    printf(" enter a string");
    gets(str);
    while(str[i]!=NULL)
    {
    i++;
    }
    printf("length of string=%d",i);
    }

    ReplyDelete

Post a Comment