68 lines
No EOL
1.5 KiB
C
68 lines
No EOL
1.5 KiB
C
//
|
|
// Created by martin on 5/21/26.
|
|
//
|
|
|
|
#include <stdio.h>
|
|
int main() {
|
|
// HELLO WORLD SECTION
|
|
printf("HELLO WORLD BELOW:\n"); // DIVIDER
|
|
char first[] = "Hello";
|
|
char second[] = "World";
|
|
printf("%s %s", first, second);
|
|
|
|
// IF/ELSE STATEMENT
|
|
printf("\n\nIF/ELSE STATEMENT BELOW:\n"); // DIVIDER
|
|
int num = 67;
|
|
if (69<num) {
|
|
printf("69 is smaller than %d ", num);
|
|
} else {
|
|
printf("69 is larger than %d ", num);
|
|
}
|
|
|
|
// SWITCH STATEMENT
|
|
printf("\n\nSWITCH STATEMENT BELOW:\n"); // DIVIDER
|
|
int meme = 1337;
|
|
switch (meme) {
|
|
case 13:
|
|
printf("she said she was twelve!");
|
|
break;
|
|
case 21:
|
|
printf("haha 9+10");
|
|
break;
|
|
case 67:
|
|
printf("lolol 67");
|
|
break;
|
|
case 69:
|
|
printf("nice");
|
|
break;
|
|
case 420:
|
|
printf("weed..");
|
|
break;
|
|
case 1337:
|
|
printf("you are elite");
|
|
break;
|
|
case 80085:
|
|
printf("do NOT put this number into a calculator");
|
|
break;
|
|
default:
|
|
printf("Sorry I do not recognise this meme");
|
|
break;
|
|
}
|
|
|
|
// WHILE LOOP
|
|
printf("\n\nWHILE LOOP BELOW:\n"); // DIVIDER
|
|
int a=1,b=7;
|
|
while (a!=b) {
|
|
a++;
|
|
b-=1;
|
|
printf("int a=%d AND int b=%d\n", a, b);
|
|
}
|
|
|
|
// FOR LOOP
|
|
printf("\n\nFOR LOOP BELOW:\n"); // DIVIDER
|
|
for (int i=0; i<=3; i++) {
|
|
printf("i=%d\n", i);
|
|
}
|
|
// END
|
|
return 0;
|
|
} |