목록C (66)
printf("ho_tari\n");
#include int sumArray(const int *pArr, int size) //int sumArray(int pArr[], int size) //int sumArray(int pArr[10], int size) { int result = 0; for (int i = 0; i < size; ++i) { result = result + pArr[i]; //*(pArr + i) } return result; } int main(void) { int nums[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int total = sumArray(nums, 10); // sumArray(&nums[0]) //int total = sumArray(nums + 5, 5); // &nums..
#include int main(void) { int nums[10] = {50, 90, 30, 100, 80, 10, 20, 40, 70, 60}; //initialized list int total = 0; for (int i = 0; i < 10; ++i) { total += nums[i]; } printf("total: %d\n", total); return 0; }
#include void printStringArray1(const char (*pArr)[20], int size) { for (int i = 0; i < size; ++i) { printf("%s\n", &pArr[i][0]); // pArr[i] } } void printStringArray2(char **pArr, int size) { for (int i = 0; i < size; ++i) { printf("%s\n", pArr[i]); // &pArr[i][0] } } int main(void) { char cities1[][20] = {"Seoul", "Los Angeles", "Paris", "Rio de janeiro", "Moscow"}; printStringArray1(cities1, ..
#include int main(void) { int height; printf("Height of pyramid : "); scanf("%d", &height); for (int i = 1; i
#include int main(void) { //int score1, score2, score3, score4, score5; int scores[5]; //scanf("%d", &score1); //scanf("%d", &score2); //scanf("%d", &score3); //scanf("%d", &score4); //scanf("%d", &score5); //scanf("%d", &score[0]); //scanf("%d", &score[1]); //scanf("%d", &score[2]); //scanf("%d", &score[3]); //scanf("%d", &score[4]); for (int i = 0; i < 5; ++i) { scanf("%d", &scores[i]); } //in..