Question:Which of the following will output the string below? "ttttt" 

A private string Tabs(uint numTabs) { IEnumerable<string> tabs = Enumerable.Repeat("t", numTabs); return (numTabs > 0) ? tabs.Aggregate((sum, next) => sum + next) : ""; } 

B private string Tabs(uint numTabs) { StringBuilder sb = new StringBuilder(); for (uint i = 0; i <= numTabs; i++) { sb.Append("t"); } return sb.ToString(); } 

C private string Tabs(uint numTabs) { string output = ""; for (uint i = 0; i <= numTabs; i++) { output += 't'; } return output; } 

D private string Tabs(uint numTabs) { String output = new String('t', numTabs); return output; } 

+ Answer
+ Report
Total Preview: 943

Copyright © 2024. Powered by Intellect Software Ltd