Even Number Pyramid :Generate the Following Pattern of Pyramid ?
2 2 4 2 4 6 2 4 6 8
Program :
#include#include void main() { int i,j,num=2; clrscr(); for(i=0;i<4 d="" for="" getch="" i="" j="0;j<=i;j++)" n="" num="num+2;" pre="" printf="" t="">4>
2 comments:
/*4.
Even Number Pyramid :Generate the Following Pattern of Pyramid
2 4
2 4 6
2 4 6 8
*/
#include
#include
int main()
{
int i,j,n;
printf("\n\t\t");
for(i=1;i<4;i++)
{
n=2;
for(j=0;j<=i;j++)
{
printf("%d ",n);
n+=2;
}
printf("\n\t\t");
}
getch();
return 0;
}
/*4.
Even Number Pyramid :Generate the Following Pattern of Pyramid
2 4
2 4 6
2 4 6 8
*/
#include
#include
int main()
{
int i,j,n;
printf("\n\t\t");
for(i=1;i<4;i++)
{
n=2;
for(j=0;j<=i;j++)
{
printf("%d ",n);
n+=2;
}
printf("\n\t\t");
}
getch();
return 0;
}
Post a Comment