Question: Write a C program that takes in an integer in the range 1 0 - 9 9 ( inclusive ) as input. The outputs are

Write a C program that takes in an integer in the range 10-99(inclusive) as input. The outputs are 1) a countdown starting
from the integer, and stopping when both output digits are odd and 2) average from all count-down numbers.
Ex: If the input is:
46
the output is:
46,45,44,43,42,41,40,39
average is42.50
Ex: If the input is:
57
the output is:
89
the output is:
{:[89,88,87,86,85,84,83,82,81,80,79]
averaqe is84.00
9
or any number not between 10 and 99(inclusive), the output is:
Input must be 10-99
For coding simplicity, follow each output number by a space, even the last one. Add a new line character after the statement
showing the average value.
Use a while loop. Compare the digits; do not write a large if-else for all possible odd-digit numbers (35,37,39,dots,65), as that
approach would be cumbersome for larger ranges.
LAB
14.8.1: Homework 3 P1: Countdown until digits are odd and find the average
ACTIVITY
#include
Write a C program that takes in an integer in the

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!