C Programming Problem : Write a C program with a function that takes an integer value (1 <- integer value < 9999) and returns the number with its digits reversed. For example, given the number 6798, the function should return 8976. Those two- original number and reversed number- numbers will pass to another function as parameters and calculate their sum. The program should use the function reverseDigits to reverse the digits and SumOriginalReverse to calculate their sum. Your output should appear in the following format: Output reverse digiS 4321 Main Enter a number between 1 and 9999: 6798 The number with its digits reversed is: 8976 6798 + 8976 - 15774 12.34 JomoriginalRevers Enter a number between I and 9999: 6655 The number with its digits reversed is: 5566 6655 + 5566 = 12221 Enter a number between 1 and 9999: 8 The number with its digits reversed is: 8 8 + 8 = 16 Enter a number between 1 and 9999: 123 The number with its digits reversed is: 321 123 + 321 = 444 Enter a number between 1 and 9999: 67 The number with its digits reversed is: 76 67 + 76 = 143 Enter a number between 1 and 9999: 12000 Out of Range Enter a number between 1 and 9999: -10 Out of Range

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.4: A Case Study: Rectangular To Polar Coordinate Conversion
Problem 9E: (Numerical) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Question
C Programming
Problem :
Write a C program with a function that takes an integer value (1 <- integer value < 9999) and
returns the number with its digits reversed. For example, given the number 6798, the function
should return 8976. Those two- original number and reversed number- numbers will pass to
another function as parameters and calculate their sum. The program should use the function
reverseDigits to reverse the digits and SumOriginalReverse to calculate their sum. Your output
should appear in the following format:
Output
reverse digiS
4321
Main
Enter a number between 1 and 9999: 6798
The number with its digits reversed is: 8976
6798 + 8976 - 15774
12.34
JomoriginalRevers
Enter a number between I and 9999: 6655
The number with its digits reversed is: 5566
6655 + 5566 = 12221
Enter a number between 1 and 9999: 8
The number with its digits reversed is: 8
8 + 8 = 16
Enter a number between 1 and 9999: 123
The number with its digits reversed is: 321
123 + 321 = 444
Enter a number between 1 and 9999: 67
The number with its digits reversed is: 76
67 + 76 = 143
Enter a number between 1 and 9999: 12000
Out of Range
Enter a number between 1 and 9999: -10
Out of Range
Transcribed Image Text:C Programming Problem : Write a C program with a function that takes an integer value (1 <- integer value < 9999) and returns the number with its digits reversed. For example, given the number 6798, the function should return 8976. Those two- original number and reversed number- numbers will pass to another function as parameters and calculate their sum. The program should use the function reverseDigits to reverse the digits and SumOriginalReverse to calculate their sum. Your output should appear in the following format: Output reverse digiS 4321 Main Enter a number between 1 and 9999: 6798 The number with its digits reversed is: 8976 6798 + 8976 - 15774 12.34 JomoriginalRevers Enter a number between I and 9999: 6655 The number with its digits reversed is: 5566 6655 + 5566 = 12221 Enter a number between 1 and 9999: 8 The number with its digits reversed is: 8 8 + 8 = 16 Enter a number between 1 and 9999: 123 The number with its digits reversed is: 321 123 + 321 = 444 Enter a number between 1 and 9999: 67 The number with its digits reversed is: 76 67 + 76 = 143 Enter a number between 1 and 9999: 12000 Out of Range Enter a number between 1 and 9999: -10 Out of Range
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 7 images

Blurred answer
Knowledge Booster
Datatypes
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr