Logo 
Search:

Visual C++ Articles

Submit Article
Home » Articles » Visual C++ » Homework HelpRSS Feeds

Copy of Program to print a histogram

Posted By: Vivek Patel     Category: Visual C++     Views: 0

A Visual C++ Program to print a histogram in the following pattern.
*
**
***
****
*****
( using array ).

Histogram

#include "stdafx.h"
#include 
#include 
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{	
    system("cls");
    int array[5]={1,2,3,4,5};

    cout<<"\n **********  Histogram  *********\n"<<endl;

    for(int count_1=0;count_1<5;count_1++)
    {
        for(int count_2=0;count_2<array[count_1];count_2++)
			cout<<"*";

        cout<<endl;
    }

    std::cin.get();
	return 0;
}
  
Share: 

 
 

Didn't find what you were looking for? Find more on Copy of Program to print a histogram Or get search suggestion and latest updates.

Vivek Patel
Vivek Patel author of Copy of Program to print a histogram is from United States. Vivek Patel says

I have started working in .Net Technology since its beta release and lucky to got chance to work on .Net 1.1, 2.0 and now working on .Net 3.5. I have worked in both C# and VB.Net for Asp.net Projects. I can also provide Sharepoint development needs. I can efficiently switch role from Tech Lead and Developer. I have comprehensive knowledge of Asp.net Development. I have been award Microsoft Most Valuable Award twice in Asp.net Technology.

Blog: http://dotnetguts.blogspot.com

 
View All Articles

 

Other Interesting Articles in Visual C++:


 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!