Monday, August 20, 2018

COUNTING CHARACTER

  • Problem Description

    Ram went to temple and his uncle asked him to count the number of characters in a text.Write a C code to help rohan count the number of characters in a text.
  • CODING ARENA::
  • #include <stdio.h>
    #include<string.h>
    int main()
    {
      char a[100];
      int b;
      scanf("%s",a);
      b=strlen(a);
      printf("%d",b);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    hai
    
    
    Expected Output
    3
  • Test Case 2

    Input (stdin)
    welcomeking
    
    
    Expected Output
    11

No comments:

Post a Comment