fork download
  1. #include <stdio.h>
  2. int main ( )
  3. {
  4.  
  5. int score; /* a test score to enter */
  6.  
  7. printf ("Enter a score: ");
  8. scanf ("%i", &score);
  9.  
  10. if (score < 0 || score > 100) /* check for an invalid score */
  11. printf (" \n Invalid score, must be between 0 and 100 \n");
  12. else if ( score >= 90 )
  13. printf (" \n You Passed the Test ... with High Honors \n");
  14. else if ( score >= 65 )
  15. printf (" \n You Passed the Test \n");
  16. else
  17. printf (" \n Sorry, You Failed the Test \n");
  18.  
  19. return (0);
  20. }
  21.  
Success #stdin #stdout 0s 5328KB
stdin
104
stdout
Enter a score:   
 Invalid score, must be between 0 and 100