언어/C언어

[C언어] 3일차 통합본 / 220321

antoroong 2025. 2. 10. 00:04

2025.02.09 - [C언어] - [C언어] 3일차 -1 할일 / if / switch / for / while / do ~ while

 

[C언어] 3일차 -1 할일 / if / switch / for / while / do ~ while

조건문ifswitch반복문forwhiledo ~ while if(조건문){참일 때 실행하는 구문} else {거짓일 때 실행하는 구문}

antoroong.tistory.com

 

 

 

 

2025.02.09 - [C언어] - [C언어] 3일차 -2 if / printf()

 

[C언어] 3일차 -2 if / printf()

If printf() #include int main(void) { int test_if_result = testIf(); int test_if_result2 = testIf_2(); int test_if_result3 = testIf_3(); return 0;}int testIf() { printf("----------- testIf 시작 -----------\n"); int a = 70; if (a

antoroong.tistory.com

 

 

 

2025.02.09 - [C언어] - [C언어] 3일차 -3 if / scanf() / 입력한 값이 홀수 인지 짝수인지 구하기

 

[C언어] 3일차 -3 if / scanf() / 입력한 값이 홀수 인지 짝수인지 구하기

If scanf()#include int main(void) { int test_scanf_1 = testScanf(); return 0;}int testScanf() { printf("----------- testScanf 시작 -----------\n\n"); int a; printf("정수를 입력해 주세요"); scanf("%d", &a); if (a % 2 == 0) { //짝수일 경우 pr

antoroong.tistory.com

 

 

 

2025.02.09 - [C언어] - [C언어] 3일차 -4 if / 중첩 if문

 

[C언어] 3일차 -4 if / 중첩 if문

중첩 if문if와 else if와 else if 등등  #include int main(void) {int test_if_result4 = testIf_4(); return 0;}int testIf_4() { printf("----------- testIf_4 종료 -----------\n\n"); int a; printf("정수를 입력해주세요 : "); scanf("%d", &a); i

antoroong.tistory.com

 

 

 

2025.02.09 - [C언어] - [C언어] 3일차 -5 switch

 

[C언어] 3일차 -5 switch

switch와 caseif 와 else를 다른 방식으로 쓰는 것이다.#include int main(void) { int test_swich_1 = testSwitch(); return 0;}int testSwitch() { printf("----------- testSwitch 시작 -----------\n\n"); int a; printf("1~4중에서 하나를 선택

antoroong.tistory.com

 

 

2025.02.10 - [C언어] - [C언어] 3일차 -6 if / scanf 응용 / 계산기 만들기

 

[C언어] 3일차 -6 if / scanf 응용 / 계산기 만들기

if / scanf 응용/계산기 만들기 #include int main(void) {int test_scanf_2 = if_scanf_2(); return 0;}int if_scanf_2() { /* scanf() 첫 번째 정수를 입력해 주세요 : 10 계산할 연산자(+, -, *, /)를 입력해 주세요 : + 두 번째 정

antoroong.tistory.com

 

 

 

2025.02.10 - [C언어] - [C언어] 3일차 -7 계산기/ switch

 

[C언어] 3일차 -7 계산기/ switch

switch#include int main(void) {int test_switch_2 = testSwitch_2(); return 0;}int testSwitch_2() { printf("----------- testSwitch_2 시작 -----------\n\n"); int num1, num2; char ch; printf("첫번째 수를 입력 :"); scanf("%d", &num1); printf("연산자

antoroong.tistory.com

 

 

 

2025.02.10 - [C언어] - [C언어] 3일차 -8 for 반복문 / 1부터 10까지 합구하기

 

[C언어] 3일차 -8 for 반복문 / 1부터 10까지 합구하기

for 반복문for(시작값; 끝값; 증가값)for(시작값; 조건문; 증가값)for(초기값; 조건식; 증가값)for(int i = 0; i for( ; ; ;) →무한 루프 발생  #include int main(void) {int test_for_1 = testFor(); return 0;}int testFor() { pri

antoroong.tistory.com

 

 

 

2025.02.10 - [C언어] - [C언어] 3일차 -9 for 반복문 / 구구단

 

[C언어] 3일차 -9 for 반복문 / 구구단

구구단#include int main(void) {int test_for_5 = testFor_5(); return 0;}int testFor_5() { /*구구단 프로그램*/ int i; int gugudan; printf("원하는 구구단은 :"); scanf("%d", &gugudan); for (i = 1; i   구구단 응용 / 모든 구구단 출

antoroong.tistory.com