Star-1

The Source for printing this in language C++ is
#include <iostream.h>

void main()
{
    int i,j,rows;
    cout<<"Enter the number of rows: ";
    cin>>rows;
    for(i=1;i<=rows;++i)
    {
        for(j=1;j<=i;++j)
        {
           cout<<"* ";
        }
        cout<<"\n";
    }
 }

______________________________________________________________________

//In C language is
#include <stdio.h>

void main()
{                                                            
    int i,j,rows;                                        
    printf("Enter the number of rows: ");
    scanf("%d", &rows);
    for(i=1;i<=rows;++i)
    {
        for(j=1;j<=i;++j)
        {
           printf("* ");
        }
        printf("\n");
    }
 }

No comments:

Post a Comment