Chapter4
This commit is contained in:
20
DeitelC/Chapter4/barChart.c
Normal file
20
DeitelC/Chapter4/barChart.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void) {
|
||||
puts("Enter 5 different integers between 1 - 30!");
|
||||
for(int i = 0; i < 5; i++) {
|
||||
printf("Enter %d. integer: ",(i+1));
|
||||
int j;
|
||||
if(!scanf("%d", &j)) {
|
||||
puts("Enter a valid integer!");
|
||||
} else if((j < 1 || j > 30)) {
|
||||
puts("Integer not between 1-30!");
|
||||
}
|
||||
|
||||
for(int t = 0; t < j; t++) {
|
||||
printf("%s","*");
|
||||
}
|
||||
puts("");
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user