📝 Added sandbox (code sketchbook)

This commit is contained in:
z3rOR0ne 2023-04-22 00:41:54 -07:00
parent b475595f7f
commit b5daf18b1a
142 changed files with 100702 additions and 0 deletions

22
sandbox/reverse_string.c Normal file
View file

@ -0,0 +1,22 @@
/* https://www.w3schools.in/c-programming/examples/reverse-a-string-in-c */
#include <stdio.h>
#include <string.h>
int main(void) {
char mystrg[60];
int leng, g;
printf("Program in C for reversing a given string\n");
printf("Please isnert the string you want to reverse: ");
scanf("%s", mystrg);
leng = strlen(mystrg);
/* goes through the mystrg[] array backwards */
for(g = leng - 1; g >= 0; g--) {
printf("%c", mystrg[g]);
}
printf("\n");
return 0;
}