1.
_______
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
answer:
#include <stdio.h>
#include <stdio.h>
int main() {
int n,i,j;
printf("enter a number\n= ");
scanf("%d",&n);
for(i=0;i<n;i++){
printf("\n");
for(j=0;j<n;j++){
printf("* ");
}
}
return 0;
}
2.
*
* *
* * *
* * * *
* * * * *
answer:
#include <stdio.h>
#include <stdio.h>
int main() {
int n,i,j;
printf("enter a number\n= ");
scanf("%d",&n);
for(i=1;i<=n;i++){
printf("\n");
for(j=1;j<=i;j++){
printf("* ");
}
}
return 0;
}
3.
* * * * *
* * * *
* * *
* *
*
answer:
#include <stdio.h>
#include <stdio.h>
int main() {
int n,i,j;
printf("enter a number\n= ");
scanf("%d",&n);
for(i=n;i>=1;i--){
printf("\n");
for(j=1;j<=i;j++){
printf("* ");
}
}
return 0;
}