C++ For Beginners
C++ Tutorial For Beginners - The C++ Guru For All -
program to inputs a five-digit number, separates the number
Question:
Write a program that inputs a five-digit number, separates the number into its individual digits and prints the digits separated from one another by three spaces each. (Hint: Use the integer division and modulus operators.)
Answer:
Program to reads in two integers and determines
Question:
Write a program that reads in two integers and determines and prints if the first is a multiple of the second. (Hint: Use the modulus operator.)
Answer:
Write a program that reads an integer Use the modulus operator
Qestion:
Write a program that reads an integer and determines and prints whether it is odd or even. (Hint: Use the modulus operator. An even number is a multiple of two. Any multiple of two leaves a remainder of zero when divided by 2.)
Answer:
Write a program that reads in five integers and determines and prints the largest and the smallest integers
Question:
Write a program that reads in five integers and determines and prints the largest and the smallest integers in the group.
Answer:
Write a program that reads in five integers and determines and prints the largest and the smallest integers in the group.
Answer:
Write a program that reads in the radius of a circle and prints the circle’s diameter
Question:
Write a program that reads in the radius of a circle and prints the circle’s diameter, circumference and area. Use the constant value 3.14159 for phi. Do these calculations in output statements. (Note: In this chapter, we have discussed only integer constants and variables. In Chapter 3 we will discuss floating-point numbers, i.e., values that can have decimal points.)
Answer:
Write a program that inputs three integers from the keyboard and prints result
Question:
Write a program that inputs three integers from the keyboard and prints the sum, average, product, smallest and largest of these numbers. The screen dialogue should appear as follows:
Input three different integers:
Sum is
Average is
Product is
Smallest is
Largest is
Answer:
Write a program that asks the user to enter two integers
Q:
Write a program that asks the user to enter two integers, obtains the numbers from the user, then prints the larger number followed by the words "is larger." If the numbers are equal, print the message “These numbers are equal.”
Answer:
Subscribe to:
Posts (Atom)