C++ Histogram 2

#include<iostream.h>
#include<conio.h>
#include<stdlib>
main(){
int n[100];
int a,b,c,z;
cout<<" Masukkan Jumlah Data : ";
cin>>z;
for(c=0;c<z;c++)
{cout<<" N["<<c<<"] = ";
 cin>>n[c];
}
system("cls");
cout<<" | PENGGAMBARAN HISTOGRAM | "<<endl;
cout<<" |elemen  |Value |Histogram "<<endl;
for (a=0; a<z; a++)
{gotoxy(2, a+3);
 cout<<" "<<a<<" ";
 gotoxy(12, a+3);
 cout<<n[a];
 gotoxy(26, a+3);
 for (b=1; b<=n[a];b++ )
 cout<<"*";
 cout<<"\n";
 }
 getch();
 }

0 Response to "C++ Histogram 2"

Posting Komentar