Recently, we have received an announcement that Adobe will stop supporting Flash Player at the end of next year. Naturally, many have raised concerns about ...
Over the past several months, many retailers have been struggling with keeping their physical stores open, leading some to bankruptcy. In addition, share ...
After upgrading to Windows 10, users can use a new feature called Quick Access in File Explorer. The Quick Access displays computer files in two groups, ...
Does your company utilize conference calls often? Conference calls can sometimes be ineffective or inefficient depending on some factors. They might seem ...
Hard drive speed: The speed of hard drive is much faster than that of many other storage devices, such as memory stick, memory card, USB flash drive and ...
Whether you want to write a term paper, organize a research project, or teach a class, you would need the right laptop which is best suited to your specific ...
Gaming has completely evolved throughout the years. With the booming e-sports industry and the amount of money that pro gamers make everybody wants to be the ...
Everyone experiences a time when they need to cut down on costs but when you’re a freelancer for a living, it might seem impossible to find money-saving ...
Bingo is a popular game where players mark off numbers on cards as they are randomly drawn by a caller. The winner is the first person to mark off all their ...
A lot can be said about the value of native mobile apps, especially in the business world. Many companies, from Walmart to Best Buy, are seeing immense success ...
Whether you're starting a new company, building a website, or developing an Android app, having a superb logo is crucial. However, designing a logo can be ...
Thinking about getting into the world of electronics? If you are looking to start designing your own electronic equipment, you should also think about creating ...
- « Previous Page
- 1
- 2
- 3
- 4
- 5
- …
- 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 !!!