Question: Problem 2 ( 1 6 Points ) : Write a C program to add up integer numbers from 1 to n where n is a

Problem 2(16 Points): Write a C program to add up integer numbers from 1 to n where n is a value that a user enters.Problem 2(16 Points): Write a C program to add up integer numbers from 1 to n where n is a value that a user enters.
Sample Code Execution: Bold text indicates information entered by the user
Enter n value: 10
Sum of 1 to 10 is 55
Enter n value: 45
Sum of 1 to 45 is 1035
Enter n value: 101
Sum of 1 to 101 is 5151
Enter n value: 250
Sum of 1 to 250 is 31375
Enter n value: 1234
Sum of 1 to 1234 is 761995
Enter n value: 5678
Sum of 1 to 5678 is 16122681
Enter n value: 34890
Sum of 1 to 34890 is 608673495
Enter n value: 50000
Sum of 1 to 50000 is 1250025000
LAB
15.13.1: Lab 2, Problem 2: Sum N numbers
P1template.c
Load default te
#include
Sample Code Execution: Bold text indicates information entered by the user
Enter n value: 10
Sum of 1 to 10 is 55
Enter n value: 45
Sum of 1 to 45 is 1035
Enter n value: 101
Sum of 1 to 101 is 5151
Enter n value: 250
Sum of 1 to 250 is 31375
Enter n value: 1234
Sum of 1 to 1234 is 761995
Enter n value: 5678
Sum of 1 to 5678 is 16122681
Enter n value: 34890
Sum of 1 to 34890 is 608673495
Enter n value: 50000
Sum of 1 to 50000 is 1250025000
LAB
15.13.1: Lab 2, Problem 2: Sum N numbers
P1template.c
Load default te
#include
Problem 2 ( 1 6 Points ) : Write a C program to

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 Programming Questions!