Question: Q1)Write a C++ program that inputs an integer and passes it to a function. The function should return the number of digits in the integer.

Q1)Write a C++ program that inputs an integer and passes it to a function. The function should return the number of digits in the integer. For example, if the integer is 35 the function should return 2, if it is 3572 the function should return 4.

Q2) Write a C++ program that inputs five numbers and passes them to a function one at a time. The function returns true if the integer is even and false otherwise.

Q3) Write a C++ program in which a function that inputs a decimal number and converts it to binary digits.

Q4) Write a C++ program to use two functions Large() and Sum(). The Large() function gets two integer arguments by reference and sets the larger number to its square. The Sum() function gets an integer argument by value and returns the sum of the individual digits of the number. The main() function inputs two integers from user and prints the sum of individual digits and square of larger number.

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!