Question: Write a void function in C named combine that has five parameters: digit1, digit2, digit3, num, and reversed_num. The parameters, digit1, digit2, digit3 are input

Write a void function in C named combine that has five parameters: digit1, digit2, digit3, num, and reversed_num. The parameters, digit1, digit2, digit3 are input parameters of type int and contain single digits. The parameters, num and reversed_num, are output parameters. The function returns two integers containing the 3 digits. One integer has the value digit1digit2digit3 and the other has the value digit3digit2digit1.For instance, if digit1=1, digit2=2, and digit3=3, then the function will return 123 and 321 via the parameters num and reversed_num. The function will do no input or output. (Hint: the number 123 is computed as follows: 1*100 + 2*10 + 3) Write a main function that will prompt the user to enter 3 digits. Main will call combine. After returning from combine, you will print the numbers returned by combine.

A sample run would look like the following: Example File Output Enter 3 digits separated by spaces: 1 2 3 After calling combine: number= 123 reversed number=321 Note: program will be tested in the LINUX environment on the CI Project, so make sure program will compile and execute in that environment.

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 Databases Questions!