#include<stdio.h>
#include<conio.h>
int main()
{
int
cypher,n,i,ascii[20],num;
char
str[20];
printf("enter shift cypher number\n");
scanf("%d",&cypher);
printf("enter the size of input characters :\n");
scanf("%d",&n);
printf("enter %d characters\n",n);
for(i=0;i<n;i++)
{
scanf("%s",&str[i]);
num=str[i];
ascii[i]=num+cypher;
}
printf("encoded characters\n");
for(i=0;i<n;i++)
{
printf("%c\n",ascii[i]);
}
printf("decoded characters\n");
for(i=0;i<n;i++)
{
ascii[i]=ascii[i]-cypher;
printf("%c\n",ascii[i]);
}
getch();
}
No comments:
Write comments