Question:
What is the C programming code for this?
Kyler Brady
2011-07-06 11:43:52 UTC
The computer
department needs a program that prints in a horizontal bar graph, the number of
students enrolled in each class section 001 - 008 for CSC 119. The user should
be prompted to enter each section number and the number of students enrolled
in that section. Use astericks to create the chart. Each asterick represents 1
student; for example:
Section
001 ************
002 *****************
003 ***************
.
.
.
Three answers:
anonymous
2011-07-06 15:49:14 UTC
Here:



http://ideone.com/zrdwn
?
2016-12-08 17:06:45 UTC
hi, it rather is in basic terms as a probability besides the undeniable fact that it variety of feels that this methodology is initiating in a DOS field, exiting today and closing down the DOS field. you're able to positioned a pause in there while this methodology is achieved. the final thank you to do it rather is by potential of including in a decision to getch() until now this methodology exits. getch() will study a single character quickly from the keyboard, without echoing it to the reveal so its appropriate for including a pause on the tip of your software. as an occasion assemble and run here 2 courses. One is with getch() and the different without and spot the version. // software a million without getch() #contain #contain void significant(void) { printf("nhello without a getch()n"); // This line will never be seen with the aid of fact the DOS field closes // today } // software 2 With getch() #contain #contain void significant(void) { printf("nhello with a getch()n"); // This line would be seen with the aid of fact the DOS field continues to be open until // the person presses a key // look ahead to person to press a key getch(); }
jplatt39
2011-07-06 12:39:31 UTC
Code guaranteed untested. Use at your own risk.



#include



int main(){



int Section[8], i, j;



for (i=0;i<8;i++)

{

printf("enter the number of students enrolled in Section 00%d:", i+1);

scanf("%d", &Section[i]);

}

printf("Section\n");

for (i=0;i<8;i++)

{

printf("00%d ". i+1);

for (j=0;j
printf("\n");

}

return 0;

}


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...