40. Display string length using pointer.


Comments

  1. poonam pusavale12:16 PM

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

    ReplyDelete
  2. Swati Waghmare12:16 PM

    /*Display the length of string by using pointer*/
    #include
    void main()
    {
    char s[8];
    int i=0;
    int *ptr;
    ptr=&s[0];
    printf("\n\tEnter a string");
    gets(s);
    while (s[i]!=NULL)
    {
    i++;
    ptr++;
    }
    printf("\n\tLength of string=%d",i);
    }

    ReplyDelete
  3. Pandhare Dipali12:18 PM

    /*pointer to pointer*/
    #include
    void main()
    {
    int i=2;
    int *j;
    int **k;
    j=&i;
    k=&j;
    {
    printf("\n\t value of j=%d",*j);
    }
    {
    printf("\n\t value of k=%d\n",**k);

    }
    }

    ReplyDelete
  4. Bhosale Dhanashri SE312:35 PM

    #include
    #include
    void main()
    {
    char s[10];
    int i=0;
    int *p;
    p=&s[0];
    printf("\n\t enter a string===");
    gets(s);
    while(*p!=NULL)
    {

    i++;
    p++;

    }
    printf("\n\t Length of string==%d",i);

    }

    ReplyDelete
  5. sachita jadhav11:00 AM

    #include
    void main()
    {
    int i=0;
    char str[8]="welcome";
    int *p1;
    p1=&str[0];
    while(*p1!=NULL)
    {
    i++;
    p1++;
    }
    printf("\n\t length =%d",i);

    }

    ReplyDelete
  6. Dipali Kore11:02 AM

    /*Display the length of string by using pointer*/
    #include
    void main()
    {
    char s[8];
    int i=0;
    int *ptr;
    ptr=&s[0];
    printf("\n\tEnter a string");
    gets(s);
    while (s[i]!=NULL)
    {
    i++;
    ptr++;
    }
    printf("\n\tLength of string=%d",i);
    }

    ReplyDelete
  7. Bhanvase Yashoda11:02 AM

    /*pointer to pointer display content*/
    #include
    void main()
    {
    char str[10]="sknscoe";
    int*p;
    p=&str[0];
    while(*p[i]|=NULL)
    {i++;
    p++;

    }
    printf("\n\t legth=%d",i);

    }










    ReplyDelete
  8. mubin pirjade11:16 AM

    /*Display the length of string by using pointer*/
    #include
    void main()
    {
    char s[8];
    int i=0;
    int *ptr;
    ptr=&s[0];
    printf("\n\tEnter a string");
    gets(s);
    while (s[i]!=NULL)
    {
    i++;
    ptr++;
    }
    printf("\n\tLength of string=%d",i);
    }

    ReplyDelete
  9. sayali daunde11:23 AM

    /*Display the length of string by using pointer*/
    #include
    void main()
    {
    char s[8];
    int i=0;
    int *ptr;
    ptr=&s[0];
    printf("\n\tEnter a string");
    gets(s);
    while (s[i]!=NULL)
    {
    i++;
    ptr++;
    }
    printf("\n\tLength of string=%d",i);
    }

    ReplyDelete
  10. Awate Snehal12:09 PM

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

    ReplyDelete
  11. sonali nagane11:24 AM

    #include
    void main()
    {
    int i=0;
    char str[8]="welcome";
    int *p1;
    p1=&str[0];
    while(*p1!=NULL)
    {
    i++;
    p1++;
    }
    printf("\n\t length =%d",i);

    }

    ReplyDelete

Post a Comment