Every year of World Backup Day is on 31 March. This year 2021 AOMEI Technology is giving three backup products for you: AOMEI Backupper ...
Cricket is oftentimes compared to baseball. Although both sports have similar elements like batsman and bowlers, which are known as batters and pitchers in ...
Office 365 is a collection of cloud-based apps that provides expandability and save cost while eliminating the need for continuous maintenance. With a ...
Before we discuss in detail the use of Java code in HTML, it would be useful to define some basic concepts. First, let’s describe the basics of Java. We will ...
Team-building activities are among the most important investments a business can make. They build trust among employees, increase conflict-resolution skills, ...
With the number of 3 billion mobile consumers forecast to use VoIP service in 2021, it comes as no surprise that more companies worldwide turn to ...
Email security has become a priority for a lot of companies and organizations. Hackers usually get access to the private data of a company through the emails ...
With the development of search engines, the strategies of search engine optimization experts are changing. If earlier to get into Google enough to write as ...
If you are starting your new business, then you must be very busy these days in all the stuff to make sure you launch is a blast, and it reaches millions of ...
Web development has surely evolved tremendously in the recent years. It is done using several programming languages and PHP is one of them. Various kinds of ...
The most common assumptions about refurbished computers are that they’re low quality or they have subpar performance. For a few products in the market, this ...
If you are working from home and reading this, you have data to prove that productivity is within your reach. This study, back in 2014, reveals that ...
- « Previous Page
- 1
- 2
- 3
- 4
- …
- 10
- Next Page »
just write if(array[j] lesser then array[j+1]) instead of if(array[j] greater then array[j+1]) and it will sort the array in descending order.
I have updated my comment with a code block containing while loop, cheers.
Okay, that’s the code of Bubble sort by using While Loop written in C++.
while(i < 4) { int j = 0; while(j < 4) { if(array[j]>array[j+1])
{
hold=array[j];
array[j]=array[j+1];
array[j+1]=hold;
}
j++;
}
i++;
}
If you have any other questions then let me know, thanks.
yes we can use a while loop.
Welcome
thanks for pointing out.
my pleasure :)
thanks for pointing out !!!