본문 바로가기

베어유

(13)
[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 ..
[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..
[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..
[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;..
[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 ..
[Day 9] Operator 2: Logical Operators and Bit operators in C Language In this class, I learned about the logical operators (e.g. &&, ||, !) and bit operators (&, |, ~, ^). 1. Logical operators - AND (&&): If A and B are true, it is denoted as 'A && B' - OR (||): If A or B are true, it is denoted as 'A || B' - NOT (!): Non-A values output as a result, it is denoted as '!A' #include #include /* run this program using the console pauser or add your own getch, system(..
[Day 8] Operator 1: Assignment, Relational, Arithmetic, Incremental Operators in C Language In this class, I learned about the operators that enable calculate or compare the variables. Here's four types of operators that easily classified to explan their functions. 1. Assignment operator - 'A = B' means that value 'B' should be assigned to variable 'A' #include #include /* run this program using the console pauser or add your own getch, system("pause") or input loop */ int main(int arg..
[Day 7] Quadratic expression for C Programming In this class, I learned about quadratic expression for specific values. Computers utilize binary, octal, and hexadecimal numbers, and their purpose of use varies depending on the pros and cons of the expression method. 1) Binary expression: 0 or 1 2) Octal expression: 0 ~ 7 3) Hexadecimal expression - 0 ~ 9 and A ~ F are used - Using %X for printing the value with printf() function And here's a..