#include <stdio.h>
#include <stdlib.h>

#define MAXLEN (50+1)

int cypher(char source[], char destination[],int key)	{
	int i;
	for(i = 0; source[i] != '\0' && i < MAXLEN; i++)	{
		destination[i] = source[i] + key;
		if(destination[i] > 125)	{
			destination[i] -= 94;
		}
	}
	destination[i] = '\0';
	return 0;
}


int main(void)	{
	char source[MAXLEN], destination[MAXLEN];
	int key;
	printf("Enter text to encrypt: ");
	scanf("%s",source);
	printf("Enter encryption key: ");
	scanf("%d",&key);
	cypher(source,destination,key);
	printf("Source:\n %s\nEncrypted:\n %s\n",source,destination);
	return 0;
}