제가 열악한 환경에서 공부중이라



직접 프로그램을 실행시켜보고 공부할 수 있는 상황이 아니라 맞은지 틀린지를 몰라

매일 프밍갤에 글을 올리게 됩니다 ..
형님들 죄송합니다 매번 감사합니다.. 혹시 도움 주시는 형님들 중에 영어 번역하기가 귀찮으신 형님들 계시면

제가 한국어로 타이핑해서 올리겠습니다 ㅠ_ㅠ..


1. Write a program that converts time in minutes to time in hours and minutes. Use

#define or const to create a symbolic constant for 60. Use a while loop to allow the

user to enter values repeatedly and terminate the loop if a value for the time of 0 or less

is entered.



2.Write a program that asks for an integer and then prints all the integers from (and

including) that value up to (and including) a value larger by 10. (That is, if the input is 5,

the output runs from 5 to 15.) Be sure to separate each output value by a space or tab or

newline.





=> 저는 이걸 아무리 생각해도 떠오르지않아서 변수2개를 잡고 한번더 입력받아서 while문을 작성했는데

이게 아닌 것 같은데 number



4. Write a program that asks the user to enter a height in centimeters and then displays the

height in centimeters and in feet and inches. Fractional centimeters and inches should

be allowed, and the program should allow the user to continue entering heights until a

nonpositive value is entered. A sample run should look like this:

Enter a height in centimeters: 182

182.0 cm = 5 feet, 11.7 inches

Enter a height in centimeters (<=0 to quit): 168.7

168.0 cm = 5 feet, 6.4

inches

Enter a height in centimeters (<=0 to quit): 0

bye




5. Change the program addemup.c ( Listing 5.13 ), which found the sum of the first 20

integers. (If you prefer, you can think of addemup.c as a program that calculates how

much money you get in 20 days if you receive $1 the first day, $2 the second day, $3 the

third day, and so on.) Modify the program so that you can tell it interactively how far

the calculation should proceed. That is, replace the 20 with a variable that is read in.


  1. #include
  2.  
  3. int main(void) {
  4. int count = 0, sum = 0, day;
  5. printf("언제까지 일을 하셨습니까?\n");
  6. scanf("%d", &day);
  7. while(count++ < day )
  8. {
  9. sum = sum + count;
  10. }
  11. return 0;
  12. }
  13.  

6. Now modify the program of Programming Exercise 5 so that it computes the sum of the
squares of the integers. (If you prefer, how much money you receive if you get $1 the
first day, $4 the second day, $9 the third day, and so on. This looks like a much better
deal!) C doesn’t have a squaring function, but you can use the fact that the square of n is
n * n .

  1. #include
  2.  
  3. int main(void) {
  4. int count = 0, sum = 0, day, pay;
  5. printf("일한 날짜를 입력해주세요.\n");
  6. scanf("%d", &day);
  7. while (count++ < day)
  8. {
  9. sum = sum + pay * pay;
  10. pay++;
  11. }
  12. return 0;
  13. }
  14.  


==> 변수를 4개 잡아줘야 하는거 맞나요 ??


7. Write a program that requests a type double number and prints the value of the number

cubed. Use a function of your own design to cube the value and print it. The main()

program should pass the entered value to this function.


  1. #include
  2. void triple(float);
  3.  
  4. int main(void) {
  5. float number;
  6. printf("float형 숫자 하나를 입력해주세요\n");
  7. scanf("%f", &number);
  8. triple(number);
  9. return 0;
  10. }
  11.  
  12. void triple(float) {
  13. printf("%f\n", number * number * number);
  14. }

==> 이 문제는 진짜 모르겠습니다 ..
대충 틀은 잡겠는데 새로운 함수를 만들때 괄호안에 뭐가 들어가야하는건가요 ?
이 문제 자세히 설명해주시면 너무 감사할것같습니다 ..ㅠㅠ
void triple(***) **에 들어가야하는거요 ...
main함수에서 triple(***); 할때도 *** 뭐 들어가야하는건가요 ?..