*
* *
* * *
* * * *
#include<stdio.h>
int main(){
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
scanf("%d", &n);
for( i = 1 ; i <= n ; i++)
{
for( j = 1 ; j <= i ; j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
{
for( j = 1 ; j <= i ; j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
*
* *
* * *
* * * *
Program 2: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf(“\n”);
}
return 0;
}
Output:
enter number of rows : 5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
Program 3: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",i);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
1
2 2
3 3 3
4 4 4 4
Program 4: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf(“%d”, &n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%c", i+64);
}
printf(“\n”);
}
return 0;
}
Output:
enter number of rows : 4
A
B B
C C C
D D D D
Program 5: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%c", j+64);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
A
A B
A B C
A B C D
Program 6: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d", j%2);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
1
1 0
1 0 1
1 0 1 0
Program 7: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d", i%2);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
1
0 0
1 1 1
0 0 0 0
Program 8: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, k=1, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%d", k);
k++;
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
1
2 3
4 5 6
7 8 9 10
Program 9: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=n;j>=i;j--)
{
printf("*");
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 5
* * * * *
* * * *
* * *
* *
*
Program 10: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=n;j>=i;j--)
{
printf("%c", i+96);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
a a a a
b b b
c c
d
Program 11: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(j=n;j>=i;j--)
{
printf("%c", j+64);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
D C B A
D C B
D C
D
Program 12: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=n;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d", j);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
1 2 3 4
1 2 3
1 2
1
Program 13: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=n;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%d", i);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
4 4 4 4
3 3 3
2 2
1
Program 14: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=n;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%c", 96+j);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
a b c d
a b c
a b
a
Program 15: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, k, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(k=n;k>i;k--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("*");
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 4
*
**
***
****
Program 16: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, k, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(k=n;k>i;k--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("* ");
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 5
*
* *
* * *
* * * *
* * * * *
Program 17: WAP to print below pattern.
#include<stdio.h>
int main()
{
int i, j, k, n;
printf("enter number of rows : ");
scanf("%d", &n);
for(i=1;i<=n;i++)
{
for(k=n;k>i;k--)
{
printf(" ");
}
for(j=1;j<=i;j++)
{
printf("%d", i);
}
printf("\n");
}
return 0;
}
Output:
enter number of rows : 5
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5