- 빡공단 30기 [Day 15] How to use one-dimensional array In this class, I learned about one-dimensional array for containing the values. Unlike general variables, one-dimensional arrangement can be accessed through an index to each space. For example, if you declare five variables, each variable must be defined with a specific value. However, if you declare a 1D array with five spaces only once, each value can be accessed through an index. /* General ..
- 빡공단 30기 [Day 14] 'Number Baseball Game' in C Programming Today's lecture covered how to make a code for 'Number Baseball Game' in C Programming. Here's the rules of 'Number Baseball Game' as below. 1. Generate 3 digits randomly 2. Enter 3 digits to get the right answer. 3. If the digit position and value of the entered number are the same, it is considered a strike. 4. The digit position of the entered number is different, but if the value is the same..
- 빡공단 30기 [Day 13] Repeated Statement: for and while I learned the 'for' and 'while' repeated statement which is used to repeatedly command a particularly actions. 1. 'For' statement This iteration operates the action code while satisfying the conditional expression from the initial condition of the variable. #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, ch..
- 빡공단 30기 [Day 12] Conditional Statement 2: switch - case In this class, I learned the conditional statement 'Switch' case. When setting conditions for an specific action, 'Switch' case complete the condition statement by directly specifying each condition. #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { switch(value) { case value1: action1; break;..
- 빡공단 30기 [Day 11] Conditional Statement 1: if and else I learned the conditional statement including 'if' and 'else'. When setting conditions for an action, we can define the action by dividing it into 'if', 'elseif', and 'else' syntax. #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int argc, char *argv[]) { if (Condition 1) { Action 1; } else if (Condition 2) { Action ..