Professional Documents
Culture Documents
Practicle:1: Source Code:-C Programming
Practicle:1: Source Code:-C Programming
#include<stdio.h>
#include<conio.h>
int main()
int i, key;
char text[100],c;
gets(text);
scanf("%d", &key);
c = text[i];
c = c - key;
{
c = c + 'z' - 'a' + 1;\
text[i] = c;
c = c - key;
c = c + 'Z' - 'A' + 1;
text[i] = c;
getch();
Output:-
Decryption
#include<stdio.h>
#include<conio.h>
int main()
int i, key;
char text[100],c;
gets(text);
scanf("%d", &key);
c = text[i];
c = c - key;
c = c + 'z' - 'a' + 1;
text[i] = c;
c = c - key;
c = c + 'Z' - 'A' + 1;
text[i] = c;
getch();
}
Output:-