Write a C program that implements the following pseudocode: 1.      Input an integer number 2.      If the number is odd, then a.       Add 1 to it b.       Divide it by 2 c.        Print the result 3.      Else if the number is even, then a.       Multiply it by 2 b.       Print the result 4.      Print your name and ID

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter6: Looping
Section: Chapter Questions
Problem 1RQ
icon
Related questions
icon
Concept explainers
Question

Write a C program that implements the following pseudocode:

1.      Input an integer number

2.      If the number is odd, then

a.       Add 1 to it

b.       Divide it by 2

c.        Print the result

3.      Else if the number is even, then

a.       Multiply it by 2

b.       Print the result

4.      Print your name and ID

Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning