As the world becomes more interconnected through the internet, running your business online has become one of the most crucial ways to stay relevant. And you ...
It's no secret that remote work has skyrocketed during the pandemic. We've gone from occasional Zoom meetings to a steady workflow of virtual meetings, cloud ...
As users' interest in decentralized technology, namely blockchain, has grown, new startups and industries based on this technology have emerged. One of the ...
By using a docker compose, you can run a Docker container in a host network mode by defining network mode in a docker-compose file. With this configuration ...
Download Nodejs with the following command on AWS Linux curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt-get install -y nodejs ...
From time immemorial, branding has acted as a powerful weapon to grow any business. When big companies have to succeed from competing brands, brand campaigns ...
The node-bacnet-contrib-extended is built on top of node-bacnet javascript library, in contrast to other bacnet plugins available in Node-red it provides ...
Securely storing data is one of the most important things in all of our lives. Haven't you ever had a security breach and your password was stolen? If so, you ...
When you feel that your computer is running slower than usual, it's not always time to buy a new device. A few simple tweaks can boost your system's ...
SERP is a web page that a searching robot gives after a searching request. SERPs results let you understand what the place of your website in Google is. The ...
If you don’t target SEO, you can miss out on a lot of leads on your website. SEO is one of the best techniques to get traffic. It gives an immediate boost to ...
JavaScript is a popular programming language. However, people still ask a similar question: “What can be done with JavaScript?” JavaScript forms the base of ...
- 1
- 2
- 3
- …
- 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 !!!