Created
October 7, 2016 15:01
-
-
Save Esarve/9429c41577d9340cf00921a31191e0a0 to your computer and use it in GitHub Desktop.
Caesar Cipher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
void cipher(char* p); | |
int main() | |
{ | |
char input[100]; | |
printf("Input Your string: "); | |
fgets(input,100,stdin); | |
cipher(&input); | |
printf("Encypted String is: "); | |
puts(input); | |
return 0; | |
} | |
void cipher(char* p) | |
{ | |
int i; | |
char input[100]; | |
i=0; | |
while(p[i]!='\0') | |
{ | |
if (p[i]==' ') | |
{ | |
i++; | |
continue; | |
} | |
p[i]=p[i]+3; | |
i++; | |
} | |
p[i]='\0'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment