INCREMENTING STRING

Description:

Write a program that takes a string as input from the user and increments all characters of the string by 1. Test Case 1 Input (stdin) JOHN Expected Output KPIO Test Case 2 Input (stdin) Hello Expected Output Ifmmp

Program :

#include <iostream>

#include<string.h>

using namespace std;

int main()

{

char s[50],ch;

  int i;

  cin>>s;

  for(i=0;i<strlen(s);i++)

  {

    ch=s[i]+1;

    cout<<ch;

  }

return 0;

}