Link to home
Start Free TrialLog in
Avatar of paStiSSet
paStiSSet

asked on

need simple code to print pair numbers and odd numbers from a previous inserted numbers

need simple code to print pair numbers and odd numbers from a previous inserted numbers
Avatar of jkr
jkr
Flag of Germany image

int numbers [] = { ... };

for ( int i = 0; i < sizeof ( numbers); ++i) {

  if ( numbers [ i] % 2) {

      printf ( "%d is odd\n", numbers [ i]);

  } else {

      printf ( "%d is even\n", numbers [ i]);
  }
}
Avatar of paStiSSet
paStiSSet

ASKER

ok is right, so i'm not looking for a code wich has the numbers inserted in the code, the numbers will be inserted by the user who runs the program :)
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hey paStiSSet

I don't believe that there is any reason to post the same question in 2 different areas

http://oldlook.experts-exchange.com/questions/20775992/need-simple-code-to-print-pair-numbers-and-odd-numbers-from-a-previous-inserted-numbers.html