I want to print the following pattern,
ABCDEFGH
ABC FGH
AB GH
A H
I wrote the following programmfor it but It ends up in an Infinite Loop. Someone please help me out.
Code:
#include <stdio.h>
#include <conio.h>
int main()
{int count1, count2,num1,num2,num3,num4,m,n;
clrscr();
for(m=4;m>=0;m--)
{
for(num1=65;num1<65+m;num1++)
{
printf("%c",num1);
}
for(count1=0;count1<=((4-m)*2);count1=count1+2)
{
while(count1>0)
{
printf(" ");
}
}
for(num2=(74-m);num2<=73;num2++)
{
printf("%c",num2);
}
printf("\n");
}
getch();
return 0;
}