C++ Histogram

#include <iostream.h>
#include <conio.h>
main()
{ int n[7] = {10,3,15,14,17,5,3};
int i,j;
cout<<"Mencetak Pola Histogram"<<endl;
for(i=0;i<7;i++)
{ cout<<"Data ke "<<i+1<<" = "<<n[i];
gotoxy (16,i+2);
for (j=1; j<=n[i];j++ )
cout<<"*";
cout<<"\n";
   }
   getch();
}

0 Response to "C++ Histogram"

Posting Komentar