Opposite right angle triangle using integers in C
------------------------------------------Program-----------------------------------------------------
------------------------------------------Output-------------------------------------------------------
#include<stdio.h> #include<conio.h> main() { int r,c,n,d=0; printf("Enter the numbers of row: "); scanf("%d",&n); for(r=0;r<=n-1;r++) { for(c=n-r;c>=1;c--) { d=d+1; printf("%d",d); } d=0; printf("\n"); } getch(); }
------------------------------------------Output-------------------------------------------------------
Screenshot for above pyramid program |
No comments