| Previous | Home | Next |
In this example we are going to print alphabets triangle which first line has A, second line B C ,third line D E F and so on .For this we are using two for loops.
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,k=65;
clrscr();
for(i=65;i<=70;i++)
{
for(j=65;j<=i;j++)
printf("%c",k++);
printf("\n");
}
getch();
}
A
B C
D E F
G H I J
K L M N O
| Previous | Home | Next |