// ---------------------------------------------------------
// Algorithm and Programming in C
// ---------------------------------------------------------
//
// Author : adhita muslim
// Written in C Language using MS Visual C++
// Copyright : 2007
//
// ---------------------------------------------------------
/*
// Encryption (Caesar Cypher)
#include
#include
void main()
{
char kata[255];
int i,n;
printf("Input string : ");gets(kata);
printf("Input value (nilai geser) : ");scanf("%i",&n);
printf("\n");
for(i=0;kata[i]!='\0';i++) // to lower case
{
if(kata[i]>64 && kata[i]<=90)
{
kata[i]=kata[i]+32;
}
}
for(i=0;kata[i]!='\0';i++)
{
if(kata[i]==32)
printf(" ");
else
printf("%c",((kata[i]-97+n)%26)+97);
}
printf("\n");
}
Home »Unlabelled » contoh enkripsi sederhana
contoh enkripsi sederhana
Posted by
Adhit
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment