Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void triangle3 (int num){
- int i, j, tmp2, sum = 1;
- char c;
- tmp2 = num-1;
- for (i = 1; i <= num; i++) {
- for (j = 1; j <= (tmp2+sum) ; j++) {
- if (j <= tmp2) c = ' ';
- else c = '*';
- printf("%c% ",c);
- }
- sum = sum+2;
- printf("\n");
- tmp2--;
- }
- }
Add Comment
Please, Sign In to add comment