fork download
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main(int argc, const char * argv[]) {
  4. /* local variable definition */
  5. char grade = 'B';
  6. switch( grade ) {
  7. case 'A':
  8. NSLog(@"Excellent!\n" );
  9. break;
  10. case 'B':
  11. case 'C':
  12. NSLog(@"Well done\n" );
  13. break;
  14. case 'D':
  15. NSLog(@"You passed\n" );
  16. break;
  17. case 'F':
  18. NSLog(@"Better try again\n" );
  19. break;
  20. default:
  21. NSLog(@"Invalid grade\n" );
  22. }
  23. NSLog(@"Your grade is %c\n", grade );
  24. return 0;
  25. }
Success #stdin #stdout #stderr 0.03s 42848KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2016-05-02 11:31:52.737 prog[12066] Well done
2016-05-02 11:31:52.738 prog[12066] Your grade is B