Ask Question
29 October, 19:49

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

+4
Answers (1)
  1. 29 October, 21:33
    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?
Get 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 & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers