- Back to Home »
- PATTERN PROGRAMS »
- c program to print z
Posted by : ANIMESH SHAW
Tuesday, 8 November 2011
#include <stdio.h>
#include<conio.h>
int main(void)
{
int i, j;
for (i = 11; i >= 1; i--)
{
for (j = 1; j <= i; j++)
{
if (i == 11)
{
printf("z"); // Makes sure the base is printed completely
continue;
}
else if (j == i)
{ // Hollows the rest
printf("z");
}
else
{
printf(" ");
}
}
printf("\n");
}
for(i=1;i<=11;i++)
printf("z");
getch();
}

Post a Comment