-
Notifications
You must be signed in to change notification settings - Fork 0
/
ROT13.c
49 lines (46 loc) · 1.19 KB
/
ROT13.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//By @aadhaar_koul_
#include<stdio.h>
#define ROT 13
int main(void)
{
int c,e;
printf("-------------TEXT TO ROT 13 ALGORITHM CONVERTER-----------\n");
printf("---------------------By aadhaar_koul_-------------------\n\n");
printf("----------------------------------------------------------\n");
printf("Type a charac or a string to get its ROT13 encripted form\n\n");
printf("CONVERT YOUR ENCRIPTION TO TEXT ON ---https://rot13.com/---\n");
printf("------------------Press ctrl+c to end---------------------\n\n");
printf("----------------------Start typing------------------------\n");
while((c=getchar())!=EOF)
{
if(c >='A' && c <='Z')
{
if((e = c + ROT) <= 'Z')
{
putchar(e);
}
else
{
e = c - ROT;
putchar(e);
}
}
else if(c >='a' && c <='z')
{
if((e= c + ROT) <= 'z')
{
putchar(e);
}
else
{
e = c - ROT;
putchar(e);
}
}
else
{
putchar(c);
}
}
return 0;
}