Results 1 to 2 of 2

Thread: Print Triangle

  1. #1
    Millerjames is offline Senior Member
    Join Date
    Dec 2009
    Posts
    331
    Rep Power
    3

    Default Print Triangle

    How to print triangle in c++ like this :

    *
    * *
    * * *
    * * * *
    * * * * *
    Last edited by Millerjames; 02-06-2010 at 03:53 PM.

  2. #2
    Davisricky is offline Senior Member
    Join Date
    Dec 2009
    Posts
    331
    Rep Power
    3

    Default

    Try to understand following code which is given below.

    # include <iostream>
    #include <conio.h>
    int printStars (int a,int b,int c);
    int main ()
    {
    printStars(a, b, c);
    return 0;
    }

    int printStars (int a,int b,int c)
    {
    int a, b, c;
    for (a=1; a<=5; a++)
    {
    for (c= 4; h >=0; c--)
    {
    cout<<" ";
    while (b=0)
    {
    for (b=1; b<=lines; b++)
    }

    {
    cout<<"* ";
    }

    }
    cout<<endl;
    }}

Similar Threads

  1. O&K Print Watch
    By Daria Lowe in forum Download Tools and Softwares
    Replies: 0
    Last Post: 08-17-2010, 10:42 AM
  2. C code for area of triangle
    By CoxWatson in forum Programming
    Replies: 2
    Last Post: 05-17-2010, 02:24 PM
  3. Write a program to Display Invert Triangle in C++.
    By GonzalezBrown in forum Programming
    Replies: 1
    Last Post: 05-03-2010, 01:40 PM
  4. Triangle C + +
    By Okaf8547 in forum Programming
    Replies: 7
    Last Post: 10-17-2009, 10:11 AM
  5. Print connect
    By qeintine641 in forum CPU & Components
    Replies: 1
    Last Post: 12-02-2008, 10:46 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
SEO by SubmitEdge

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48