Question: Write a program that, given an integer N N , sums all the whole numbers from 1 through N N ( both inclusive ) .
Write a program that, given an integer
N
N sums all the whole numbers from through
N
N both inclusive Do not include in your sum any of the intermediate values and
N
N inclusive that are divisible by or
Input:
Your program should read lines from standard input. Each line contains a positive integer.
Output:
For each line of input, print to standard output the sum of the integers from through n disregarding those divisible by and Print out each result on a new line.
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
