Write a program to sort the string by using bubble sort
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
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
Amit MohantyRank #112 · 20K reputationPosted Oct 30, 2022, 5:13 AM EDT
Check this
string[] arrString = {"Amit", "Work", "Swarup", "C Sharp", "Coding", "Example"}; int n = arrString.Length; string tempString; for (int j = 0; j 0) { tempString = arrString[j]; arrString[j] = arrString[i]; arrString[i] = tempString; } } } Console.WriteLine("After Sorting Array :"); for (int i = 0; i < n; i++) Console.WriteLine(arrString[i]);