The code takes input(the string) to be encoded and a key from the user such that when the key is added to the input the input is increased by the amount of the given key . For ex. if the key is 2, so the input A changes to C, b changes to d, and so on.
I have written a code for the same but cannot get the output.
int main()
{
int x,i,y,c;
char text[20];
printf("enter the plaintext:");
gets(text);
printf("enter the key: ");
scanf("%d",&x);
for (y=0;y<strlen(text);y++)
{
if (text[i]>='a'&&text[i]<='z'&&text[i]>='A'&&text[i]<='Z' )
{
int c=(int)text[i]+x;
printf("%c\n",text[i]);
}
}
}
The result that i am getting is blank. kindly help me.