Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main()
- {
- printf("\t\t\tWelcome to ASCII converter\n");
- printf("\t\t\t--------------------------\n");
- int operation;
- char encrypt_char;
- int decrypt_char;
- while(1)
- {
- printf("\n\nSelect Encryption/Decryption\n\nPress 1 for Encryption - Press 2 for Decryption : ");
- scanf("%d",&operation);
- scanf("%*c");
- if(operation == 1)
- {
- printf("\nEnter String : ");
- while(1)
- {
- scanf("%c",&encrypt_char);
- if(encrypt_char == 10) break;
- printf("%d ",encrypt_char);
- }
- }
- else if(operation == 2)
- {
- printf("\nEnter String (Enter 0 to submit) : ");
- while(1)
- {
- scanf("%d",&decrypt_char);
- if(decrypt_char == 0) break;
- printf("%c",decrypt_char);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement