Initial set of scripts
This commit is contained in:
15
C files/99bottles
Executable file
15
C files/99bottles
Executable file
@@ -0,0 +1,15 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned int bottles = 99;
|
||||
do
|
||||
{
|
||||
printf("%u bottles of beer on the wall\n", bottles);
|
||||
printf("%u bottles of beer\n", bottles);
|
||||
printf("Take one down, pass it around\n");
|
||||
printf("%u bottles of beer on the wall\n\n", --bottles);
|
||||
} while(bottles > 0);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
15
C files/99bottles.c
Executable file
15
C files/99bottles.c
Executable file
@@ -0,0 +1,15 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
unsigned int bottles = 99;
|
||||
do
|
||||
{
|
||||
printf("%u bottles of beer on the wall\n", bottles);
|
||||
printf("%u bottles of beer\n", bottles);
|
||||
printf("Take one down, pass it around\n");
|
||||
printf("%u bottles of beer on the wall\n\n", --bottles);
|
||||
} while(bottles > 0);
|
||||
return EXIT_SUCCESS;
|
||||
}
|
BIN
C files/a.out
Executable file
BIN
C files/a.out
Executable file
Binary file not shown.
BIN
C files/strings
Executable file
BIN
C files/strings
Executable file
Binary file not shown.
22
C files/strings-and-if-else.c
Executable file
22
C files/strings-and-if-else.c
Executable file
@@ -0,0 +1,22 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main() {
|
||||
char * name = "nigger";
|
||||
int age = 28;
|
||||
printf("%s, is you\n",name);
|
||||
|
||||
//use strncmp function from string.h to compare strings
|
||||
//the number 3 is the length of fag
|
||||
if ( strncmp(name, "fag", 3) == 0 ) {
|
||||
printf("This fag is identified and is %d\n", age);
|
||||
}
|
||||
else if (strncmp(name, "nigger", 6) == 0){
|
||||
printf("you are a %s\n", name);
|
||||
}
|
||||
else {
|
||||
printf("I don't know you\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user