ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 4 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 05 May 2017 My Price 8.00

describing the C program

A one page paper describing the C program written below. State the requirements for the program and discuss the logical process the program uses to meet those 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("nnThe grades are: n");

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

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

}

Answers

(11)
Status NEW Posted 05 May 2017 07:05 AM My Price 8.00

-----------

Not Rated(0)