Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void prchar (char c, int n)
- {
- for (int i=0; i<n; i++)
- printf("%c",c);
- }
- void tri(int h)
- {
- if (h==1)
- {
- prchar('*', 1);
- printf("\n");
- }
- else
- {
- prchar('*', h);
- printf("\n");
- tri(h-1);
- }
- }
- int main()
- {
- int h;
- printf("Enter the integer: ");
- scanf("%d",&h);
- printf("\n");
- tri(h);
- printf("\n\n\n");
- system("pause");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement