Modify program 1 above so that it computes and then


Program 1: Design a program in C which, when executed, will do the following in the indicated sequence:

1. Ask the user to type on the keyboard any user-supplied value of a positive integer number n.

2. The program will then compute, for one time only, using the WHILE looping command, the value of the number called here zNo(n) defined as the sum of the squares of all the integers lying between and including 1 and n, i.e., tNo(n) = 12 + 22 + 32 + ...+ n2.

3. The program is then to display on the console the user-supplied value of n as well as the corresponding value of zNo(n) in the format shown below: n=3 ===> zNo(3)=14.

Program 2: Modify program 1 above so that it computes and then displays on the console computations of zNo(n) for a user-specified values of n as in Program 1 but now in an infinite loop.

Program 3: Modify program 1 above so that it computes and then displays on the console computations of zNo(n) for a user-specified value of n as in Program 1 but now for a user-specified number of times denoted ntimes.

Program 4: Modify program 1 above so that it computes and then displays on the console computations of the function mzNo(nstart,nstop), called modified zNo(n) and defined as the sum of the squares of all the integers lying between and including nstart and nstop, i.e., mzNo(nstart,nstop) = nstart2 + (nstart+1)2 + (nstart+2)2 + ...+ (nstop-1)2 + nstop2.

In this program, the computation of mzNo is to take place a user-specified number of times. Flowcharts: Draw a flowchart for each of the above four programs.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Modify program 1 above so that it computes and then
Reference No:- TGS02899779

Expected delivery within 24 Hours