1// Encryption : A is replaced by B, B is replaced by C and Z is replaced by A
2
3#include <stdio.h>
4#include <string.h>
5void main()
6{
7 char arr[100];
8 int i;
9
10 printf("Enter the array: ");
11 gets(arr);
12
13 for(i=0; i<strlen(arr); i++)
14 {
15 if (arr[i]>=65 && arr[i]<90)
16 arr[i] = arr[i] + 1;
17
18 else if (arr[i]>=97 && arr[i]<122)
19 arr[i] = arr[i] + 1;
20
21 else if (arr[i] == 90)
22 arr[i] ='A';
23
24 else if (arr[i] == 122)
25 arr[i] ='a';
26
27 else
28 printf("enter characters");
29 }
30
31 printf("\nEncrypted message is: \n\n");
32
33 puts(arr);
34}
35