Problem Description
Write a program to generate a following #s triangle:
# # # # #
# # # #
# # #
# #
#CODING ARENA
#include <stdio.h>
int main()
{
int n,c;
scanf("%d",&n);
for(;n>=1;n--)
{
for(c=1;c<=n;c++)
printf("#");
printf("\n");
}
return 0;
}
Test Case 1
Input (stdin)5
Expected Output##### #### ### ## #
Test Case 2
Input (stdin)7
Expected Output####### ###### ##### #### ### ## #
No comments:
Post a Comment