Get premium membership and access questions with answers, video lessons as well as revision papers.
#include
#include
#define max 10
int list[max]={1,0,8,3,7,2,9,4,6,5};
void display(){
int i;
printf("[");
for(i=0;i printf("%d",list[i]);
}
printf("]\n");
}
void bubblesort(){
int i,j;
int temp;bool swapped=false;
for(i=0;i swapped =false;
for(j=0;j printf("\nitems compaired :[%d,%d]",list[j],list[j+1]);
if(list[j]>list[j+1]){
temp=list[j];
list[j]=list[j+1];
list[j+1]=temp;
swapped=true;
printf("=> swapped [%d,%d]\n",list[j],list[j+1]);
}else
{
{
printf(" => not swapped\n");}
}
}
if(!swapped){
break;
}
printf("\nIteration %d :" , (i+1));
display();
}
}
int main()
{
printf("input array\n");
display();
printf("\n");
bubblesort();
display();
printf("\n\tOutput array is:");
display();
return 0;
}
rabin answered the question on November 20, 2017 at 09:34
- Outline the advantages of renting a computer.(Solved)
Outline the advantages of renting a computer.
Date posted: November 19, 2017. Answers (1)
- Outline the methods of procurement of a computer.(Solved)
Outline the methods of procurement of a computer.
Date posted: November 19, 2017. Answers (1)
- Why do you think employees can resist to adapt new technology?(Solved)
Why do you think employees can resist to adapt new technology?
Date posted: November 19, 2017. Answers (1)
- Outline the advantages of system decision table.(Solved)
Outline the advantages of system decision table.
Date posted: November 19, 2017. Answers (1)
- Outline the limitations of using system flowcharts.(Solved)
Outline the limitations of using system flowcharts.
Date posted: November 19, 2017. Answers (1)
- What are the main duties of programming manager?(Solved)
What are the main duties of programming manager?
Date posted: November 19, 2017. Answers (1)
- What are the personal qualities of a good analyst?(Solved)
What are the personal qualities of a good analyst?
Date posted: November 19, 2017. Answers (1)
- What are the characteristics of transaction processing system?(Solved)
What are the characteristics of transaction processing system?
Date posted: November 19, 2017. Answers (1)
- Outline the objectives of office automation system (OAS)(Solved)
Outline the objectives of office automation system (OAS)
Date posted: November 19, 2017. Answers (1)
- Explain three ways that computer technology could make office more efficient(Solved)
Explain three ways that computer technology could make office more efficient
Date posted: November 18, 2017. Answers (1)
- Discuss the advantages for a company moving towards an object oriented programming approach (Solved)
Discuss the advantages for a company moving towards an object oriented programming approach
Date posted: November 18, 2017. Answers (1)
- The electronic business (e-business) field is growing and changing rapidly resulting in the need to address certain infrastructural issues to support it.Required:Suggest the possible contribution...(Solved)
The electronic business (e-business) field is growing and changing rapidly resulting in
the need to address certain infrastructural issues to support it.
Required:
Suggest the possible contribution of the following systems in e-business applications:
(i) Smart Cards
(ii) Electronic Data Interchange (EDI) systems
(iii) World Wide Web (WWW)
(iv) Automatic Teller Machines (ATMs)
Date posted: November 18, 2017. Answers (1)
- Examine the contribution of information systems in decision-making or problem solving process.(Solved)
Examine the contribution of information systems in decision-making or problem solving process.
Date posted: November 18, 2017. Answers (1)
- What is the link between database technology and client/server computer systems?(Solved)
What is the link between database technology and client/server computer systems?
Date posted: November 18, 2017. Answers (1)
- User training and support is fundamental to the success of an information systems project. Produce a brief document that discusses the usefulness of training.(Solved)
User training and support is fundamental to the success of an information systems
project. Produce a brief document that discusses the usefulness of training.
Date posted: November 18, 2017. Answers (1)
- Give one reason to support the importance of controlling data inputs and discuss any
four methods that you may use to control data inputs.(Solved)
Give one reason to support the importance of controlling data inputs and discuss any
four methods that you may use to control data inputs.
Date posted: November 18, 2017. Answers (1)
- Discuss the Important System Concepts.(Solved)
Discuss the Important System Concepts.
Date posted: November 18, 2017. Answers (1)
- Describe four types of information systems.(Solved)
Describe four types of information systems.
Date posted: November 18, 2017. Answers (1)
- What are different Phases of System Development Life Cycle?(Solved)
What are different Phases of System Development Life Cycle?
Date posted: November 18, 2017. Answers (1)
- List three factors to be considered when purchasing a microcomputer(Solved)
List three factors to be considered when purchasing a microcomputer
Date posted: November 18, 2017. Answers (1)