목록C (66)
printf("ho_tari\n");
#include int main(void) { //printf("1\n"); //printf("2\n"); //printf("3\n"); //... //printf("10\n"); int i; i = 1; while (i
#include #include long long power(int base, int exponent) { long long result = 1; for (int i = 0; i < exponent; ++i) { result *= base; } return result; } int main(void) { int base = 2; int exponent = 10; long long result = power(base, exponent); printf("%d^%d = %lld\n", base, exponent, result); return 0; }
#include long long power(int base, int exponent) { long long result = 1LL; for (int i = 1; i
#include int main(void) { int num; scanf("%d", &num); if (num > 0) { printf("%d is a positive number\n", num); } else if (num == 0) { printf("%d is zero number\n", num); } else { printf("%d is a negative number\n", num); } return 0; } #include int main(void) { int num; scanf("%d", &num); /* if (num > 0) { printf("%d is a positive number\n", num); } else if (num == 0) { printf("%d is zero number\..
#include int main(void) { int nums[] = {1, 2, 3, 4, 5}; int *p; p = nums; for (int i = 0; i < 5; ++i) { printf("%d ", nums[i]); } printf("\n"); for (int i = 0; i < 5; ++i) { printf("%d ", *(nums + i)); } printf("\n"); for (int i = 0; i < 5; ++i) { printf("%d ", *(p + i)); } printf("\n"); for (int i = 0; i < 5; ++i) { printf("%d ", p[i]); } printf("\n"); return 0; }