Exercise: Display a Triangle

Write code to solve the problem.

Question

Write a program that displays a triangle with height nn and base width 2n12n−1.

The expected output for n=6n = 6 would be a triangle with height 66 and a base width 1111:

     *
    ***
   *****
  *******
 *********
***********
Show Hint

Exercise: Display a Triangle

Write code to solve the problem.

Question

Write a program that displays a triangle with height nn and base width 2n12n−1.

The expected output for n=6n = 6 would be a triangle with height 66 and a base width 1111:

     *
    ***
   *****
  *******
 *********
***********
Show Hint
C
#include <stdio.h>
int main(void) {
// Your code goes here
return 0;
}