Created
January 14, 2012 17:57
-
-
Save yesidays/1612263 to your computer and use it in GitHub Desktop.
code.jobs - Pyramid of asterisks - C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include<stdio.h> | |
int main(){ | |
int height; | |
printf("Enter the number of levels "); | |
scanf("%d",&height); | |
for (int rows=1; rows<=height; rows++){ | |
for (int whites=1; whites<=height-rows; whites++){ | |
printf(" "); | |
} | |
for (int columns=1; columns<=2*rows-1; columns++){ | |
printf("*"); | |
} | |
printf("\n"); | |
}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment