WAP to Implement Mono-alphabetic Algorithm


            #include<stdio.h>
#include<conio.h>
void main()
{
int i,j,len;
char      c[50],p[50],k[26]={'m','e','h','p','x','a','w','q','y','d','i','s','z','b','o','g','c','u','f','j','v','t','k','n','l','r'},l[26]={'M','E','H','P','X','A','W','Q','Y','D','I','S','Z','B','O','G','C','U','F','J','V','T','K','N','L','R'};
clrscr();
printf("Enter the plain text:");
gets(p);
len=strlen(p);
for(i=0;i<len;i++)
{
if(p[i]<123 && p[i]>96)
{
j=p[i];
c[i]=k[j-97];
}
if(p[i]<91 && p[i]>64)
{
j=p[i];
c[i]=l[j-65];
}
}
c[i]=NULL;
printf("The cipher text is:\n %s",c);
getch();
}

Related Posts Plugin for WordPress, Blogger...

Engineering material

GTU IDP/ UDP PROJECT

GTU IDP/ UDP PROJECT

Patel free software download

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Back to TOP