분류 전체보기(36)
-
#30 (C) while4.c
#include int main() { /* int total=0; int num=0; do { printf("Enter the number (0 to quit): "); scanf("%d", &num); total += num; } while (num!=0); printf("Total:%d\n", total); return 0; int total=0; int num; while (num!=0) { printf("Enter the number (0 to quit): "); scanf("%d", &num); total += num; } printf("Total: %d\n", total); return 0; */ int num=0; int total=0; printf("Enter the number (0 t..
2022.09.21 -
#29 (C) while3.c
#include int main() { int i=0; int j=0; while (i
2022.09.21 -
#28 (C) while2.c
#include int main() { int n=0; int i=0; float total=0; while(i
2022.09.21 -
#27 (C) two_to_nine.c
#include int main() { int i=2; int n; while (i cd "c:\Users\user\Desktop\cprog\" ; if ($?) { gcc two_to_nine.c -o two_to_nine } ; if ($?) { .\two_to_nine } i: 2 2 x 1 = 2 2 x 2 = 4 2 x 3 = 6 2 x 4 = 8 2 x 5 = 10 2 x 6 = 12 2 x 7 = 14 2 x 8 = 16 2 x 9 = 18 i: 3 3 x 1 = 3 3 x 2 = 6 3 x 3 = 9 3 x 4 = 12 3 x 5 = 15 3 x 6 = 18 3 x 7 = 21 3 x 8 = 24 3 x 9 = 27 i: 4 4 x 1 = 4 4 x 2 = 8 4 x 3 = 12 4 x 4..
2022.09.21 -
#26 (C) while1.c
#include int main() { /* int num = 0; int i = 0; printf("Enter the number: "); scanf("%d", &num); while (i
2022.09.21 -
#25 (C) scanf_type.c
#include int main(void) { int num1, num2, num3; double num4; float num5; long double num6; printf("Enter the six values: "); scanf("%d %d %d %lf %f %Lf", &num1, &num2, &num3, &num4, &num5, &num6); printf("num1: %d %o %x\n", num1, num1, num1); printf("num2: %d %o %x\n", num2, num2, num2); printf("num3: %d %o %x\n", num3, num3, num3); printf("num4: %f\n", num4); printf("num5: %f\n", num5); printf(..
2022.09.21