fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4.  
  5.  
  6. int main(int argc, const char * argv[])
  7. {
  8.  
  9. for(int x = 79; x < 83; ++x)
  10. if ( x % 2 == 0 )
  11. {
  12. printf( "%d is ", x );
  13. printf( "%s\n", "even" );
  14. }
  15. else
  16. {
  17. printf( "%d is ", x );
  18. printf( "%s\n", "odd" );
  19. }
  20.  
  21. for(int x = 79; x < 83; ++x)
  22. {
  23. ( x % 2 == 0 )
  24. ? (printf( "%d is ", x ), printf( "%s\n", "even" ))
  25. : (printf( "%d is ", x ), printf( "%s\n", "odd" ));
  26. }
  27. }
  28.  
  29.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
79 is odd
80 is even
81 is odd
82 is even
79 is odd
80 is even
81 is odd
82 is even