Write a COMPLETE and an EFFICIENT C program that should ask the user to enter the number of terms n from 1 to 30. Validate the user input. Your code should repeatedly display “Incorrect Value, Please Try Again”, till the user enters the correct value. On having correct input, the program should display the following series upto n terms as: 1000 + 998 + 995 + 991 + 986 + 980 + 973+… Your code should also display the average of all these values (upto n terms). Sample output: (Suppose the user enters n as 9) 1000 + 998 + 995 + 991 + 986 + 980 + 973 + 965 + 956 average = 982.666687
Copyright © 2020 - | Universal Programmer
0 Comments