C Programming Awareness and Practice
A Student Effort .... By Shshank Singhal Ajmer, Rajasthan, India
Pages
HOME
BASIC
RECURSION
ARRAY
STRINGS
CONVERSIONS
Q. Print a alphabetic triangle ?
THE OUTPUT WOULD BE
#include<stdio.h>
#include<conio.h>
void main( )
{
clrscr( );
int i,j,k;
for(i=1;i<=5;i++)
{ for(j=5;j>1;j--)
{ printf(" ");
}
for(k=1;k<=i;k++)
{ printf("* ");
}
printf("\n");
}
getch( );
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment