When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
13 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
#include <iostream>
using namespace std;
void bubblesort(int a[])
{
for (int i=0; i<5; i++)
{
for (int j=0; j<(5-i-1); j++)
{
if (a[j]>a[j+1])
{
int temp = a[j];
a[j]=a[j+1];
a[j+1]= temp;
}
}
}
}
int main ()
{
int n [5];
for (int i=0; i<5; i++)
{
cin>>n[i];
}
bubblesort (n);
for (int i=0; i<5; i++)
{
cout <<n[i]<<" ";
}
return 0;
}```
@limpid portal
Please don't delete forum posts. They can be helpful to refer to later and other members can learn from them. You can use !solved to close a post and mark it as solved.
;compile | 1 7 3 2 4
1 2 3 4 7
just print the last element of the aray?
Hi.
hi?
what don’t you understand about literally the most basic guidelines for communication on forums like this
troll
check their history
I mean I kinda don’t need to, this isn’t the first time