๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

โœ’๏ธ C Programming/๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ_๊ฐœ์ • 3ํŒ31

[๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ - ๊ฐœ์ • 3ํŒ] 9์žฅ Programming ํ’€์ด # 9์žฅ Programming ํ’€์ด 370p_1๋ฒˆ) #include int get_array_sum(int* A, int size) { int sum = 0; for (int i = 0; i < size; i++) { sum += A[i]; } return sum; } int main() { int data[10] = { 1,2,3,4,5,6,7,8,9 }; int *p; p = data; printf("print_array()\n"); for (int k = 0; k < 10; k++) { printf("%d ", data[k]); } printf("\n๋ฐฐ์—ด ์š”์†Œ์˜ ํ•ฉ: %d\n", get_array_sum(data, 10)); return 0; } 370p_2๋ฒˆ) #include void invers.. 2023. 1. 22.
[๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ - ๊ฐœ์ • 3ํŒ] 9์žฅ Mini Project ๋ฌธ์ œ ํ’€์ด # 9์žฅ Mini Project ๋ฌธ์ œ ํ’€์ด 367p_Mini Project_Pointer ์‚ฌ์šฉ X) #include #include char getinputt; int main() { char origin_map[10][10] = { {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0'}, {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0'}, {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0'}, {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0'}, {'0', '0', '0', '0', '0', '0', '0', '0', '0', '0'}, {'0', '.. 2023. 1. 21.
[๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ - ๊ฐœ์ • 3ํŒ] 8์žฅ Programming ํ’€์ด (2) # 8์žฅ Programming ํ’€์ด (2) 337p_8๋ฒˆ) #include #include void cal(double a, double b, double c) { if (b * b - 4 * a * c > 0) { double one = (-b + sqrt(b * b - 4 * a * c)) / (2 * a); double two = (-b - sqrt(b * b - 4 * a * c)) / (2 * a); printf("์ฒซ ๋ฒˆ์งธ ๊ทผ = %.4lf\n", one); printf("๋‘ ๋ฒˆ์งธ ๊ทผ = %.4lf\n", two); } else { printf("๊ทผ์ด ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค."); } } int main() { double x, y, z; printf("2์ฐจ ๋ฐฉ์ •์‹์˜ ๊ณ„์ˆ˜๋ฅผ ์ž…๋ ฅํ•˜์‹œ์˜ค:\n"); pr.. 2023. 1. 20.
[๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ - ๊ฐœ์ • 3ํŒ] 8์žฅ Programming ํ’€์ด (1) # 8์žฅ Programming ํ’€์ด (1) 336p_1๋ฒˆ) #include void cal(double a, double b) { printf("x = "); scanf_s("%lf", &a); printf("y = "); scanf_s("%lf", &b); printf("f(x,y) = %.3lf\n\n", (1.5 * a) + (3.0 * b)); } int main() { while (1) { double x = 0; double y = 0; cal(x, y); } return 0; } 336p_2๋ฒˆ) #include double get_bigger(double a, double b) { printf("์‹ค์ˆ˜๋ฅผ ์ž…๋ ฅํ•˜์‹œ์˜ค: "); scanf_s("%lf", &a); printf("์‹ค์ˆ˜๋ฅผ ์ž…๋ ฅํ•˜์‹œ์˜ค: .. 2023. 1. 18.
[๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ - ๊ฐœ์ • 3ํŒ] 8์žฅ Mini Project ๋ฌธ์ œ ํ’€์ด # 8์žฅ Mini Project ๋ฌธ์ œ ํ’€์ด 332p_Mini Project) #include int current_money = 0; int main_home(int a) { printf("\n************* Welcome to ์ฝ˜์„œํŠธ ATM *************\n"); printf("******* ํ•˜๋‚˜๋ฅผ ์„ ํƒํ•˜์‹œ์˜ค *******\n"); printf(" ์ž”๊ณ  ํ™•์ธ\n"); printf(" ์ž…๊ธˆ\n"); printf(" ์ธ์ถœ\n"); printf(" ์ข…๋ฃŒ\n"); scanf_s("%d", &a); return a; } int current() { return current_money; } int add() { int plus = 0; printf("\n์ž…๊ธˆ ๊ธˆ์•ก์„ ์ž…๋ ฅํ•˜์‹œ์˜ค: "); sca.. 2023. 1. 16.
[๋ˆ„๊ตฌ๋‚˜ ์‰ฝ๊ฒŒ ์ฆ๊ธฐ๋Š” C ์–ธ์–ด ์ฝ˜์„œํŠธ - ๊ฐœ์ • 3ํŒ] 7์žฅ Programming ํ’€์ด (2) # 7์žฅ Programming ํ’€์ด (2) 291p_9๋ฒˆ) #include #include #include int main() { int most, num; int array[10] = { 0 }; srand(time(NULL)); for (int i = 0; i array[a - 1]) { most = a; } } printf("๊ฐ€์žฅ ๋งŽ์ด ์ƒ์„ฑ๋œ ์ˆ˜: %d", most); return 0; } 292p_10๋ฒˆ) #include #include int.. 2023. 1. 15.