Facebook
From Eratic Cheetah, 2 Years ago, written in Plain Text.
This paste is a reply to Untitled from Trivial Ibis - view diff
Embed
Download Paste or View Raw
Hits: 119
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     printf("Enter a value and find out if the number is even \n");
  6.     int num = 0;  /// the number
  7.     scanf("%d", &num);
  8.     printf("%d is %s \n", num , ((num % 2) ? "odd" : "even"));     ///ternary if function
  9.  
  10.     return 0;
  11. }
  12.