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

Viewing 2 reply threads
  • Author
    Posts
    • #2163
      SilviaJamieson
      Participant

      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
      GWILouisaxwzkla
      Participant

      could do

    • #3489
      SilviaJamieson
      Participant

      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

Viewing 2 reply threads
  • The forum ‘C Programming’ is closed to new topics and replies.