Question: ( 5 5 % ) Write a C# program that ( a ) ( 1 0 % ) Prompts for an integer n ( that

(55%) Write a C# program that
(a)(10%) Prompts for an integer n(that you type from keyboard)
(b)(30%) Display the following: (like in Q1, except 10 is replaced by n)
Sum of 1+2+3+=+n is 1 in iteration 1?
Sum of 1+2+3+=+n is 3 in iteration 12
Sum of 1+2+3+dots+n is 6 in iteration 3?
Until the last iteration
Sum of 1+2+3+=+n is in iteration n
Note that if n=10, the output is the same as Q 1.
If n=20, your output will look like
Sum of 1+2+3+=+20 is 1 in iteration 12
Sum of 1+2+3+=+20 is 3 in iteration 12
Sum of 1+2+3+=+20 is 6 in iteration 3
Sum of 1+2+3+dots+20 is 190 in iteration 19?
Sum of 1+2+3+=+20 is 210 in iteration 20(from the formula, we know 1+2+=+n=nn+12, so with n=
20, sum =210
(c)(15%) Test and show your program's output for three different n :
n=10,n=20, and n= an integer between 11 and 19 picked by you.
Note. Your code of course wark for any n such as n=100,n=200, etc. but refrain from doing that since too
many lines of outputs will be generated.
( 5 5 % ) Write a C# program that ( a ) ( 1 0 % )

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!