Ask Question

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.

+1
Answers (1)
  1. 30 September, 09:25
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers