Saturday, August 18, 2018

FIND NO OF CHARACTERS IN NAME

  • Problem Description

    Manoj arranged one event to find no of characters in his friends name, your idea is to give your friends name, for that
    manoj has to answer the no of characters present in it, with the help of sturcuture concept accomplish it.

    Input Method

    Name of different friends 

    Output Method

    No of characters

    Use Structure Concepts

  • CODING ARENA
  • #include <stdio.h>
    #include<string.h>
    struct slen
    {
      char str[100];
      int ln;
    }s;
    int main()
    {
      scanf("%s",s.str); 
      s.ln=strlen(s.str);
      printf("%d\n",s.ln); 
      return 0;
    }
  • Test Case 1

    Input (stdin)
    raja
    
    
    Expected Output
    4
  • Test Case 2

    Input (stdin)
    rambabu
    
    
    Expected Output
    7

No comments:

Post a Comment