#include <stdio.h> // There should be no spaces between # and include
#include <stdlib.h>
int main (void)
{
int n = 9; // initialize n to the value you want
for (int i=0; i<n; i++) // deleted the semicolon
{
// You print spaces until n - 1 - i
for (int j=0; j<n-1-i; j++) // deleted the semicolon
printf (" ");
// After printing spaces print * until n
for (int k=n-1-i; k<n;k++)
printf ("* ");
printf ("\n");
}
system ("PAUSE"); // use cin.get() or something
return 0;
}
Reputation Points: 572
Solved Threads: 115
Mentally Challenged Mod.
Offline 1,559 posts
since Jun 2005