#include<stdio.h>
int main()
{
int i,j;
for(i=97;i<=100;i++) // This loop prints part-1 using ASCII value
{
for(j=97;j<=i;j++)
{
printf("%c",j);
}
printf("\n");
}
for(i=99;i>=97;i--) // This loop prints part-2 using ASCII value
{
for(j=97;j<=i;j++)
{
printf("%c",j);
}
printf("\n");
}
return 0;
}
#include<stdio.h>
int main()
{
char i,j; // Here, variable i and j are defined as character type.
for(i='a';i<='d';i++) // This loop print part-1 using character value
{
for(j='a';j<=i;j++)
{
printf("%c",j);
}
printf("\n");
}
for(i='c';i>='a';i--) //This loop prints part-2 using character value
{
for(j='a';j<=i;j++)
{
printf("%c",j);
}
printf("\n");
}
return 0;
}