Ask Question
26 April, 16:07

Write a function named printtriangle that receives a parameter that holds a non-negative integer value and prints a triangle of asterisks as follows: first a line of n asterisks, followed by a line of n-1 askterisks, and then a line of n-2 asterisks, and so on.

+3
Answers (1)
  1. 26 April, 19:00
    0
    Static void PrintTriangle (int n) { for (; n>0; n--) { Console. WriteLine (new String ('*', n)); }}
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a function named printtriangle that receives a parameter that holds a non-negative integer value and prints a triangle of asterisks ...” 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