Question: In 2 to 3 paragraphs describe the C program written below (What the program is supposed to do). State the requirements for the program (How

In 2 to 3 paragraphs describe the C program written below (What the program is supposed to do). State the requirements for the program (How does the program meet the requirements) and discuss the logical process your program uses to meet those requirements (The process steps to meet the requirements).

#include "stdio.h"

int main(void)

{

//initialize array int arr[100];

//initialize variables int i=0, j=0, n=0;

//infinite loop which will stop when user enters -1 while(n != -1)

{

printf("Enter percentage grade(0-100). Enter -1 to stop: ");

//read grade scanf("%d",&n);

//if user entered grade is not -1 if(n != -1) { //save it to array arr[i++] = n; } //if user entered -1, then exit this loop else {

break;

} } printf(" The grades are: ");

//loop which will iterate till no:of user entered grades for(j=0; j

{ //print the grade printf("%d ",arr[j]);

} return 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 Databases Questions!