fork download
  1. #include <stdio.h>
  2. #include <conio.h>
  3.  
  4. int main() {
  5. int hours, fee;
  6.  
  7. printf("<<<<<<<<<<Red bike rental shop>>>>>>>>>>\n");
  8. printf("Sudamon Chom-a 5/10 no.17\n");
  9. printf("Enter the number of hours you rent the red bike : ");
  10. scanf("%d", &hours);
  11.  
  12. if (hours < 3) {
  13. fee = hours * 50;
  14. } else if (hours <= 6) {
  15. fee = hours * 45;
  16. } else {
  17. fee = hours * 40;
  18. }
  19.  
  20. printf("Red bicycle rental fee: %d Bath", fee);
  21. getch();
  22. return 0;
  23. }
Success #stdin #stdout 0.03s 25528KB
stdin
Standard input is empty
stdout
#include <stdio.h>
#include <conio.h>

int main() {
    int hours, fee;
    
    printf("<<<<<<<<<<Red bike rental shop>>>>>>>>>>\n");
    printf("Sudamon Chom-a 5/10 no.17\n");
    printf("Enter the number of hours you rent the red bike : ");
    scanf("%d", &hours);

    if (hours < 3) {
        fee = hours * 50;
    } else if (hours <= 6) {
        fee = hours * 45;
    } else {
        fee = hours * 40;
    }

    printf("Red bicycle rental fee: %d Bath", fee);
    getch();
    return 0;
}