Dartz Admin

Number of posts: 18 Age: 22 Registration date: 2008-11-15
 | Subject: Displaying Triangles with *'s or 1's using Loops Mon Dec 29, 2008 12:42 pm | |
| | Code: | #include<stdio.h> #include<conio.h>
void main() { int n,i,j,k; clrscr(); printf("Enter the Number of Lines: "); scanf("%d",&n);
for(i=1;i<=n;i++) { printf("\n\n");
for(j=n;j>=i;j--) { printf("\t"); }
for(k=1;k<=i;k++) { printf("*\t\t"); } }
getch(); } |
Output:
n=4
* * * * * * * * * *
I'll put up the Screenshot later. I've been Busy for the past few weeks >_> and will update most of the programs in a week or two from today.
~ Dartz_________________ ~Administrator~If you join my side, you have nothing to fear... If not, then farewell! |
|