annotate asciicaesar.c @ 2:c96b197faa9d default tip

Autmatic Win32 Porting
author VilyaemKenyaz
date Thu, 28 Sep 2023 13:20:40 -0400
parents d0fbe0f50dfb
children
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[]){
2
c96b197faa9d Autmatic Win32 Porting
VilyaemKenyaz
parents: 0
diff changeset
8 char *string = argv[1];
c96b197faa9d Autmatic Win32 Porting
VilyaemKenyaz
parents: 0
diff changeset
9 int modifier = atoi(argv[2]);
c96b197faa9d Autmatic Win32 Porting
VilyaemKenyaz
parents: 0
diff changeset
10 char newchar;
c96b197faa9d Autmatic Win32 Porting
VilyaemKenyaz
parents: 0
diff changeset
11 for(int i = 0;i != strlen(string);i++){
c96b197faa9d Autmatic Win32 Porting
VilyaemKenyaz
parents: 0
diff changeset
12 newchar = string[i] + modifier;
c96b197faa9d Autmatic Win32 Porting
VilyaemKenyaz
parents: 0
diff changeset
13 printf("%c",newchar);
c96b197faa9d Autmatic Win32 Porting
VilyaemKenyaz
parents: 0
diff changeset
14 }
c96b197faa9d Autmatic Win32 Porting
VilyaemKenyaz
parents: 0
diff changeset
15 exit(0);
0
d0fbe0f50dfb finished program supposedly
VilyaemKenyaz
parents:
diff changeset
16 }