1
*****
*****
*****
*****
*****
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
printf("*");
}
printf("\n");
}
getch();
}
2
*
**
***
****
*****
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
3.*****
****
***
**
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i<=j)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
4
*****
****
***
**
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if((i+j)<=6))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
5 *
**
***
****
*****
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if((i+j)>=6))
pintf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
6
*
*
*****
*
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i==3!!j==3)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
7
* *
* *
*
*
* *
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if((i==j!!(i+j)==6))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
8
* * * * *
* *
* *
* *
* * * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i==1!!i==5!!j==1!!j==5)
printf(" *");
else
printf(" ");
}
printf("\n");
}
getch();
}
9.
* * * *
*
* * * *
* *
* * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=4;j++)
{
if(i==1!!i==3!!i==5!!j==1)
printf("* ");
else
printf(" ");
}
printf("\n");
}
getch();
}
10
* * * *
* *
* * * *
* *
* *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=4;j++)
{
if(i==1!!i==3!!j==1!!j==4)
printf("*");
else
printf(" ");
}
printf("\n);
}
getch();
}
11.
* * * *
*
* * * *
* *
* * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=4;j++)
{
if(i==3||i==3||i==5||(i==2&&j==1)||(i==4&&j==4)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
12.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("%d",i)
else
printf(" ");
}
printf("\n");
}
getch();
}
13.
* *
* *
*
*
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i==j && i<=3)||((i+j)==6&& i<=3)||(j==3&&i>=3))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
14
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("%d",j);
else
printf(" ");
}
printf(" \n");
}
getch();
}
15.
A
B B
C C C
D D D D
E E E E E
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("%C",(i+64));
else
printf(" ");
}
printf(" \n");
}
getch();
}
16.
A
A B
A B C
A B C D
A B C D E
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("%C",(j+64));
else
printf(" ");
}
printf(" \n");
}
getch();
}
17.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i+j)>=6)
printf("%d",(i));
else
printf(" ");
}
getch();
}
18.
11111
2222
333
44
5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
19.
11111
22222
33333
44444
55555
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=5;j>=1;j--)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
20.
54321
54321
54321
54321
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=5;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
21.
A
AB
ABC
ABCD
ABCDE
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=1,ch='A';j<=i;j++;ch++)
{
printf("%c",ch);
}
printf("\n");
}
getch();
}
22
ABCDE
ABCD
ABC
AB
A
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=5,ch='A';j>=i;j--;ch++)
{
printf("%c",ch);
}
printf("\n");
}
getch();
}
23
AAAAA
AAAA
AAA
AA
A
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=5,ch='A';j>=i;j--;ch++)
{
printf("%c",'A');
}
printf("\n");
}
getch();
}
24.
A
AA
AAA
AAAA
AAAAA
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=1,ch='A';j<=i;j==;ch++)
{
printf("%c",'A');
}
printf("\n");
}
getch();
}
25.
AAAAA
AAAAA
AAAAA
AAAAA
AAAAA
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=1,ch='A';j<=5;j++,ch++)
{
printf("%c",'A');
}
printf("\n");
}
getch();
}
26.
AAAAA
BBBBB
CCCCC
DDDDD
EEEEE
#include<stdio.h>
#include<conio.h>
void main()
{
char i,j;
clrscr();
for(i='A';i<='E';i++)
{
for(j='A';j<='E';j++)
{
printf("%c",i);
}
printf("\n");
}
getch();
}
27.
ABCDE
ABCDE
ABCDE
ABCDE
ABCDE
#include<stdio.h>
#include<conio.h>
void main()
{
char i,j;
clrscr();
for(i='A';i<='E';i++)
{
for(j='A';j<='E';j++)
{
printf("%c",j);
}
printf("\n");
}
getch();
}
28.
55555
44444
33333
22222
11111
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=5;i<=5;i--)
{
for(j=5;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
29
EEEEE
DDDDD
CCCCC
BBBBB
AAAAA
#include<stdio.h>
#include<conio.h>
void main()
{
char i,j;
clrscr();
for(i='E';i>='A';i++)
{
for(j='E';j>='A';j--)
{
printf("%c",i);
}
printf("\n");
}
getch();
}
30
EDCBA
EDCBA
EDCBA
EDCBA
EDCBA
#include<stdio.h>
#include<conio.h>
void main()
{
char i,j;
clrscr();
for(i='E';i>='A';i--)
{
for(j='E';j>='A';j--)
{
printf("%c",J);
}
printf("\n");
}
getch();
}
*****
*****
*****
*****
*****
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
printf("*");
}
printf("\n");
}
getch();
}
2
*
**
***
****
*****
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
3.*****
****
***
**
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i<=j)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
4
*****
****
***
**
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if((i+j)<=6))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
5 *
**
***
****
*****
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if((i+j)>=6))
pintf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
6
*
*
*****
*
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i==3!!j==3)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
7
* *
* *
*
*
* *
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if((i==j!!(i+j)==6))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
8
* * * * *
* *
* *
* *
* * * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i==1!!i==5!!j==1!!j==5)
printf(" *");
else
printf(" ");
}
printf("\n");
}
getch();
}
9.
* * * *
*
* * * *
* *
* * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=4;j++)
{
if(i==1!!i==3!!i==5!!j==1)
printf("* ");
else
printf(" ");
}
printf("\n");
}
getch();
}
10
* * * *
* *
* * * *
* *
* *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=4;j++)
{
if(i==1!!i==3!!j==1!!j==4)
printf("*");
else
printf(" ");
}
printf("\n);
}
getch();
}
11.
* * * *
*
* * * *
* *
* * * *
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=4;j++)
{
if(i==3||i==3||i==5||(i==2&&j==1)||(i==4&&j==4)
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
12.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("%d",i)
else
printf(" ");
}
printf("\n");
}
getch();
}
13.
* *
* *
*
*
*
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i==j && i<=3)||((i+j)==6&& i<=3)||(j==3&&i>=3))
printf("*");
else
printf(" ");
}
printf("\n");
}
getch();
}
14
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("%d",j);
else
printf(" ");
}
printf(" \n");
}
getch();
}
15.
A
B B
C C C
D D D D
E E E E E
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("%C",(i+64));
else
printf(" ");
}
printf(" \n");
}
getch();
}
16.
A
A B
A B C
A B C D
A B C D E
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i>=j)
printf("%C",(j+64));
else
printf(" ");
}
printf(" \n");
}
getch();
}
17.
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=1;j<=5;j++)
{
if(i+j)>=6)
printf("%d",(i));
else
printf(" ");
}
getch();
}
18.
11111
2222
333
44
5
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=5;j>=i;j--)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
19.
11111
22222
33333
44444
55555
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=5;j>=1;j--)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
20.
54321
54321
54321
54321
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
{
for(j=5;j>=1;j--)
{
printf("%d",j);
}
printf("\n");
}
getch();
}
21.
A
AB
ABC
ABCD
ABCDE
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=1,ch='A';j<=i;j++;ch++)
{
printf("%c",ch);
}
printf("\n");
}
getch();
}
22
ABCDE
ABCD
ABC
AB
A
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=5,ch='A';j>=i;j--;ch++)
{
printf("%c",ch);
}
printf("\n");
}
getch();
}
23
AAAAA
AAAA
AAA
AA
A
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=5,ch='A';j>=i;j--;ch++)
{
printf("%c",'A');
}
printf("\n");
}
getch();
}
24.
A
AA
AAA
AAAA
AAAAA
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=1,ch='A';j<=i;j==;ch++)
{
printf("%c",'A');
}
printf("\n");
}
getch();
}
25.
AAAAA
AAAAA
AAAAA
AAAAA
AAAAA
#include<stdio.h>
#include<conio.h>
void main()
{
char ch='A';
int i,j;
for(i=1;i<=5;i++)
{
for(j=1,ch='A';j<=5;j++,ch++)
{
printf("%c",'A');
}
printf("\n");
}
getch();
}
26.
AAAAA
BBBBB
CCCCC
DDDDD
EEEEE
#include<stdio.h>
#include<conio.h>
void main()
{
char i,j;
clrscr();
for(i='A';i<='E';i++)
{
for(j='A';j<='E';j++)
{
printf("%c",i);
}
printf("\n");
}
getch();
}
27.
ABCDE
ABCDE
ABCDE
ABCDE
ABCDE
#include<stdio.h>
#include<conio.h>
void main()
{
char i,j;
clrscr();
for(i='A';i<='E';i++)
{
for(j='A';j<='E';j++)
{
printf("%c",j);
}
printf("\n");
}
getch();
}
28.
55555
44444
33333
22222
11111
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j;
for(i=5;i<=5;i--)
{
for(j=5;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
getch();
}
29
EEEEE
DDDDD
CCCCC
BBBBB
AAAAA
#include<stdio.h>
#include<conio.h>
void main()
{
char i,j;
clrscr();
for(i='E';i>='A';i++)
{
for(j='E';j>='A';j--)
{
printf("%c",i);
}
printf("\n");
}
getch();
}
30
EDCBA
EDCBA
EDCBA
EDCBA
EDCBA
#include<stdio.h>
#include<conio.h>
void main()
{
char i,j;
clrscr();
for(i='E';i>='A';i--)
{
for(j='E';j>='A';j--)
{
printf("%c",J);
}
printf("\n");
}
getch();
}
No comments:
Post a Comment