Ask Question
29 March, 10:20

Write code that causes a "triangle" of asterisks of size n to be output to the screen. specifically, n lines should be printed out, the first consisting of a single asterisk, the second consisting of two asterisks, the third consisting of three, etc. the last line should consist of n asterisks. thus, for example, if n has value 3, the output of your code should be

+3
Answers (1)
  1. 29 March, 13:16
    0
    Like this

    #include void pa (int n) { if (! n) { printf ("/n"); return; }printf ("*"); pa (n-1); }void lines (int n) {if (! n) return; lines (n-1); pa (n); }int main (void) {lines (5); return 0; }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write code that causes a "triangle" of asterisks of size n to be output to the screen. specifically, n lines should be printed out, the ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers