I have created the program and generate code below
#include <stdio.h> int main(){ int a,i; scanf("%d",&a); while(a!=-1){ if(a>=0 && a<=80){ for(i=a;i<=a;i++) printf("|"); printf("%d\n"); scanf("%d",&a); } }
with input 1 3 4 4 5 5 -1, it should be display a bar chart like
|
| | |
| | | |
| | | |
| | | | |
| | | | |
but in that codes ,display |
|
|
|
|
|
can anybody explain why its not working?