Thursday, September 13, 2018

PRINTING NEXT

  • Problem Description

    Latha and Trisha are friends. They love to play with words. Ishu gives them a task to replace each characters in a string with its next letter. Can you help them to complete this task?
  • CODING ARENA
  • #include <stdio.h>
    #include<string.h>
    int main()
    {
      int a[100],i,l;
      char s1[100];
      scanf("%s",s1);
      l=strlen(s1);
      for(i=0;i<l;i++)
      {
        a[i]=s1[i];
        a[i]=a[i]+1;
        s1[i]=a[i];
      }
      printf("%s",s1);

    return 0;
    }
  • Test Case 1

    Input (stdin)
    abc
    
    
    Expected Output
    bcd
  • Test Case 2

    Input (stdin)
    Appa
    
    
    Expected Output
    Bqqb

No comments:

Post a Comment