Question: Ques 1) Write a C++ program that accepts any number from user and then calculates the sum of all number between 1 and the given
Ques 1)
Write a C++ program that accepts any number from user and then calculates the sum of all number between 1 and the given number.
You may use any looping construct to implement your solution.
Ex1:
Enter any number: 6
Sum of numbers from 1 to 6 is 21.
Ex2:
Enter any number: 10
Sum of numbers from 1 to 10 is 55.
Ques 2)
Write a program to ask user to enter a number, and then count the total number of digits in the entered number.
Ex:
Enter any number: 6768
Total number of digits in 6768 are 4.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
