Wednesday 12 September 2012

Histogram

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d,e,f,i=1;
cout<<"Enter the 5 digit Integer=";
cin>>a>>b>>c>>d>>e;
while(i<=a)
{
 cout<<"*";
 i++;
 }
 i=1;
 cout<<endl;
 while(i<=b)
 {
  cout<<"*";
  i++;
  }
  cout<<endl;
  i=1;
  while(i<=c)
  {
  cout<<"*";
  i++;
  }
  cout<<endl;
  i=1;
  while(i<=d)
  {
  cout<<"*";
  i++;
  }
  cout<<endl;
  i=1;
  while(i<=e)
  {
  cout<<"*";
  i++;
  }

  getch();
  }

No comments:

Post a Comment