Write a program in C to print following pattern or opposite pyramid or opposite trinagle.
###########
#########
#######
#####
###
#
#include<stdio.h>
#include<conio.h>
main()
{
int n;
clrscr();
printf("Enter the number of rows you want to print\t);
scanf("%d",&n);
for(int r=n;r>=1;r--){
for(int s=1;s<=n-r;s++){
printf(" ");
}
for(int p=1-r;p<r;p++){
printf("#"); \*put anythinh from sajjadsaeed*/
}
printf("\n");
}
getch();
}
For Download Click below
###########
#########
#######
#####
###
#
#include<stdio.h>
#include<conio.h>
main()
{
int n;
clrscr();
printf("Enter the number of rows you want to print\t);
scanf("%d",&n);
for(int r=n;r>=1;r--){
for(int s=1;s<=n-r;s++){
printf(" ");
}
for(int p=1-r;p<r;p++){
printf("#"); \*put anythinh from sajjadsaeed*/
}
printf("\n");
}
getch();
}
For Download Click below
No comments:
Post a Comment