{-='Number of Rows using Dev-C LaNGuaGe'=-}
Number of Rows
#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
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.