Create a code segment using a while loop


Discuss the below:

Q1.Write a code segment using a while loop that outputs the numbers from -10 to 10.

Q2. Write a looping code segment that takes as input up to 20 integer scores from file indata, and outputs their average. if the file contains fewer than 20 scores, the segment should still output the correct average. if the file contains more than 20 scores, the additional numbers should be ignored. be sure to consider what a happens if the file is empty.

 

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Create a code segment using a while loop
Reference No:- TGS01936901

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)