Anda di halaman 1dari 1

LAB SESSION 4 Question 1 Write a full C++ program that reads a three-digit integer through one integer variable,

separates the integer into its individual digits and prints the digits separated from one another. For example, if the user types 549, the program should print; 5 4 9

Question 2 Write a full C++ program that reads three separate integer numbers through three integer variables, combine the three integer numbers to become a three-digit integer number and print it on screen. For example, if the user types 3 6 9, the program should print; 369

Question 3 Combine the two solutions of Question 1 and Question 2 as a single C + + file. Make each one as a function. Your program should have the following functions prototype: int combine (int, int, int); //solution for Question 1 void separate (int); //solution for Question 2

Anda mungkin juga menyukai