The program isnt working perfectly.

// What I want to do is enter "T" no of lines. Then displace each character in //the line by two ASCII value
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>

using namespace std;
char G[100];
void convert()
{
for(int i=0;i<=100;i++)
{
G[i]=G[i]+2;
}
}

int main()
{
int T,i;

scanf("%d",&T);

for(i=1;i<=T;i++)
{
cin.getline(G,100);

convert();

printf("Case %d: \n",i);
for(int i=0;i<=100;i++)
{
printf("%c",G[i]);
}
}
getch();
return 0;
}
-------------------------
INPUT:
2
abcdefgh ijkl
mno pqr

OUTPUT:
cdefghij klmn
opq rst
Topic archived. No new replies allowed.