C++ Fast please Write a program in C++ to do the following tasks. a) Read a number N from the user. b) Using recursion generate and find sum of the numbers which are divisible by 3 starting from N and ends with 0. c) Print the numbers and sum as shown in the below output. Note: A number is divisible by 3 if the remainder after dividing the number with 3 is zero. Sample output 1: Enter a number: 15 Numbers are: 15 12 sum of the numbers are:45 Sample output 2: Enter a number: 20 18 Numbers are: 15 sum of the numbers are:63 12 3 3 e

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
C++
Fast please
Write a program in C++ to do the following tasks.
a) Read a number N from the user.
b) Using recursion generate and find sum of the numbers which are divisible by 3 starting from N and ends with 0.
c) Print the numbers and sum as shown in the below output.
Note: A number is divisible by 3 if the remainder after dividing the number with 3 is zero.
Sample output 1:
Enter a number: 15
15
Numbers are:
12
sum of the numbers are:45
Sample output 2:
Enter a number: 20
Numbers are:
18
15
sum of the numbers are:63
12
3
6
3
8
Transcribed Image Text:C++ Fast please Write a program in C++ to do the following tasks. a) Read a number N from the user. b) Using recursion generate and find sum of the numbers which are divisible by 3 starting from N and ends with 0. c) Print the numbers and sum as shown in the below output. Note: A number is divisible by 3 if the remainder after dividing the number with 3 is zero. Sample output 1: Enter a number: 15 15 Numbers are: 12 sum of the numbers are:45 Sample output 2: Enter a number: 20 Numbers are: 18 15 sum of the numbers are:63 12 3 6 3 8
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Array
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr