Program to print 1,2,3,4.
Write a program to print 1,2,3,4,5,6,7,8,9,10.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Nitin SontakkeRank #264 · 9.6K reputationPosted Sep 18, 2016, 1:06 AM EDT
Y G173 reputationPosted Sep 18, 2016, 1:12 AM EDT
Nitin SontakkeRank #264 · 9.6K reputationPosted Sep 18, 2016, 4:21 AM EDT
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 18, 2016, 4:33 AM EDT
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 18, 2016, 4:35 AM EDT
Delpin Susai RajRank #53 · 29.5K reputationPosted Sep 18, 2016, 4:36 AM EDT
Dinesh SanthalingamRank #2,085 · 690 reputationPosted Sep 18, 2016, 8:15 PM EDT
kunal gaikwad15 reputationPosted Sep 18, 2016, 8:25 PM EDT
Jisny AvRank #4,868 · 321 reputationPosted Sep 18, 2016, 9:34 PM EDT
for (int i = 1; i <= n; i++)
{
output += i + ",";
}
output = output.TrimEnd(',');
Console.writeLine(output);
Lokesh KumarRank #4,352 · 349 reputationPosted Sep 18, 2016, 10:07 PM EDT
Please Try This It may helps you.
string str = "";
for(int i=1;i<=10;i++)
{
str += i + ",";
}
if(str!="")
{
str = str.Substring(0, str.Length - 1);
Console.WriteLine(str);
Console.ReadLine();
}