All pastes #80537 Raw Edit

switchstatement

public text v1 · immutable
·published 2006-07-06 14:44 UTC
rendered paste body
switch (choice)
         {
                case '1': printf("You have uploaded a total of: %dB", upspd * secs);
                     break;
                case '2': printf("You have uploaded a total of: %fkB", (float) upspd * secs / 1024);
                     break;
                case '3': printf("You have uploaded a total of: %fmB", (float) upspd * secs / 1024 / 1024);
                     break;
                default: printf("You didn't type 1, 2 or 3...");
                     break;
         }
    while (choice != 1 || choice != 2 || choice != 3)
    {
          choice = getchar();
          fflush(stdin);
          printf("You didn't type 1, 2 or 3...");
    }
    getch();
    return(0);
}