Hello friends today i am trying to print the follwing pattern just see the code and give me your views about this code and if you have a better code than share with me..
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k;
clrscr();
for(i=1;i<=4;i++)
{
for(k=1;k<=i;k++)
printf(" ");
for(j=1;j<=i;j++)
printf(" *");
printf("\n");
}
for(i=3;i>=1;i--)
{
for(k=1;k<=i;k++)
printf(" ");
for(j=1;j<=i;j++)
printf(" *");
printf("\n");
}
getch();
return(0);
}
Thanks Guys....
* * * * * * * * * * * * * * * *
#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,k;
clrscr();
for(i=1;i<=4;i++)
{
for(k=1;k<=i;k++)
printf(" ");
for(j=1;j<=i;j++)
printf(" *");
printf("\n");
}
for(i=3;i>=1;i--)
{
for(k=1;k<=i;k++)
printf(" ");
for(j=1;j<=i;j++)
printf(" *");
printf("\n");
}
getch();
return(0);
}
Thanks Guys....
No comments:
Post a Comment
Please Give Me Your Views