annotate asciicaesar.c @ 1:ba8447ba5f5c

Fully functional.
author VilyaemKenyaz
date Wed, 23 Aug 2023 14:10:27 -0400
parents d0fbe0f50dfb
children c96b197faa9d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
1 // Encryption and Decryption Program
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
2
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
3 #include <stdio.h>
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
4 #include <stdlib.h>
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
5 #include <string.h>
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
6
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
7 void main(int argc, char*argv[]){
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
8 char *string = argv[1];
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
9 int modifier = atoi(argv[2]);
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
10 char newchar;
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
11 for(int i = 0;i != strlen(string);i++){
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
12 newchar = string[i] + modifier;
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
13 printf("%c",newchar);
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
14 }
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
15 exit(0);
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
16 }