Ads Top

Diamond program using c

       #include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b;
for(a=0;a<10;a++)
{
for(b=0;b<a;b++)
cout<<b;
cout<<end1;
}
for(a=10;a>=0;a--)
{
for(b=0;b<a;b++)
cout<<b;
cout<<end1;
}
getch();

}


OUTPUT:
0
01
012
0123
01234
012345
0123456
01234567
012345678
0123456789
012345678
01234567
0123456
012345
01234
0123
012
01
0

No comments:

Touchfeeds. Powered by Blogger.