Just create a file Binary.txt in "D drive", then compile and execute the following code. #include<iostream> #include<fstream> ...
You have to create two files named students_file.txt and file.html. Below is the program code:- #include <iostream> #include <fstream> ...
If you are new to Java, you must be asking yourself a lot of questions as you continue to see many different terms starting with the letter “J”. Of course, ...
You've probably gathered by now that your website needs to be all about your mobile audience these days. In fact, not having a mobile friendly website could be ...
Most people use self-storages to get rid of items they don’t necessarily need, but are too financially or emotionally valuable to be thrown in the trash. We ...
Java code development should be done efficiently and java development India experts do it by applying design methodologies into applications. In this article, ...
You will learn basics of Amazon DynamoDB used by java enterprise development experts for projects. In this post, you will learn about the key areas of this DB ...
In few years, cloud computing has revolutionized into the future of the internet. Rackspace however, is on the top in revolutionizing the noted edge of the ...
In this article, we have listed the top 5 web hosting companies you may find in the UK, who in our 14 years of experience given top quality with affordable ...
When we talk about the native advertisement, we are talking about advertising in the new media. Native ads are paid content which is created by advertisers, ...
Merge Sort is based on a divide and conquer algorithm. It is very easy to implement, and very fast sorting technique. The efficiency/performance is ...
Selection sorting is inefficient with a large number of unsorted data. As its name selection, it does the same. It get the lowest number from the unsorted list ...
- « Previous Page
- 1
- …
- 3
- 4
- 5
- 6
- 7
- …
- 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 !!!