Number of Rows

clarence_cool03 0 Tallied Votes 142 Views Share

{-='Number of Rows using Dev-C LaNGuaGe'=-}

#include<stdio.h>

int main(void)
{
//  Local Declarations
    int numRows;
   
//  Statements
    printf("How many rows do you want to have?");
    scanf("%d", &numRows);
   
    int outerCount;
    for(outerCount = 1; outerCount <= numRows; outerCount++)
      {
          int innerCount;
          for(innerCount = 1; innerCount <= outerCount; innerCount++)
             if(outerCount <= innerCount)
                printf("*");
          
             else
                printf("**");
                printf("\n");                           
      }// for
      
    system("pause");
    return 0;
}// main