C program that reads an integer odd/even?

Home Forums C Programming C program that reads an integer odd/even?

This topic contains 2 replies, has 2 voices, and was last updated by  SilviaJamieson 8 years, 11 months ago.

  • Author
    Posts
  • #2163

    Lab assignment 4 – Question 1.

    Hi everyone,

    I’m new to C++ programming and i am finding it a little bit confusing, any help would be great. :oops:

    Write a C program that reads an integer number and then determines and prints whether it is odd or even number.

    „ Use simplest form if statement
    „ Use scanf function to read an integer input from keyboard
    „ Use printf function to display the result

    • If it is odd number, display the message “? is an odd number”.
    • If it is even number, display the message “? is an even number”
    „ Hint : Use the remainder operator. An even number is a multiple of two. Any multiple of two leaves a
    remainder of zero when divided by 2.

    Thanks for any help……daisy :P

  • #3488

    could do

  • #3489

    Thank you, dman

    I can understand it when someone lays it out nice and simple as you have done. I really appreciate the assistance, and I feel so much better now, thanks again…. :D

You must be logged in to reply to this topic.

0 Shares
Share
+1
Tweet
Share
Stumble