SlideShare a Scribd company logo
8886781233
17368915236
#include
#include
int main() {
int i, n, *data , p;
/* get the number of inputs from the user */
printf("Enter the number of inputs:");
scanf("%d", &n);
/* dynamically allocate memory to store i/p values */
data = (int *) malloc(sizeof(int) * n);
/* get the input data from the user */
for (i = 0; i < n; i++) {
printf("data[%d]: ", i);
scanf("%d", &data[i]);
}
/* sorts the given numbers */
bubbleSort(data, n ,p );
}
void bubbleSort(int *data, int n , int p) {
int i, temp, k = 1, l,j;
if (n > 0) {
for (i = n; i > 0; i--) {
if (data[i] > data[i - 1])
{
temp = data[i];
data[i] = data[i - 1];
data[i - 1] = temp;
}
if( p = = 0)
{
p++;
l = n;
for ( i = 0 ; i < n ; i++)
{
prinft ( %d, data[i])
}
bubbleSort(data, i - 2 , p );
}
else
{
for ( j = n - 1 ; j < l ; j++)
{
if (data[j] > data[j - 1])
{
temp = data[j];
data[j] = data[j - 1];
data[j - 1] = temp;
}
}
for ( j = 0 ; j < l ; j++)
{
prinft ( %d, data[j])
}
bubbleSort(data, i - 2,p);
}
}
}
return;
}
Solution
8886781233
17368915236
#include
#include
int main() {
int i, n, *data , p;
/* get the number of inputs from the user */
printf("Enter the number of inputs:");
scanf("%d", &n);
/* dynamically allocate memory to store i/p values */
data = (int *) malloc(sizeof(int) * n);
/* get the input data from the user */
for (i = 0; i < n; i++) {
printf("data[%d]: ", i);
scanf("%d", &data[i]);
}
/* sorts the given numbers */
bubbleSort(data, n ,p );
}
void bubbleSort(int *data, int n , int p) {
int i, temp, k = 1, l,j;
if (n > 0) {
for (i = n; i > 0; i--) {
if (data[i] > data[i - 1])
{
temp = data[i];
data[i] = data[i - 1];
data[i - 1] = temp;
}
if( p = = 0)
{
p++;
l = n;
for ( i = 0 ; i < n ; i++)
{
prinft ( %d, data[i])
}
bubbleSort(data, i - 2 , p );
}
else
{
for ( j = n - 1 ; j < l ; j++)
{
if (data[j] > data[j - 1])
{
temp = data[j];
data[j] = data[j - 1];
data[j - 1] = temp;
}
}
for ( j = 0 ; j < l ; j++)
{
prinft ( %d, data[j])
}
bubbleSort(data, i - 2,p);
}
}
}
return;
}

More Related Content

DOC
Sorting programs
DOCX
ADA FILE
DOCX
DAA Lab File C Programs
PPTX
LectureSlidData_sturcture_algorithm_v2.pptx
PDF
PDF
Data structure programs in c++
PPT
Sorting programs
ADA FILE
DAA Lab File C Programs
LectureSlidData_sturcture_algorithm_v2.pptx
Data structure programs in c++

Similar to 888678123317368915236 #include stdio.h #include stdlib.h.pdf (20)

DOCX
PDF
DSA.pdf
PPT
PPT
Unit6 C
DOCX
Write a complete C programme to implement the following sorting algor.docx
PDF
Program of sorting using shell sort #include stdio.h #de.pdf
DOCX
DAA Lab Work.docx
DOCX
Data Structure in C (Lab Programs)
DOCX
Data Structures Using C Practical File
RTF
Sortings
PPT
C Language Unit-6
DOCX
Assignment
PPT
Unit6 jwfiles
DOC
Ds program-print
DOC
Daapracticals 111105084852-phpapp02
PDF
Hi,Please fidn the Answer.Sorting,h is Header .pdf
DOC
An example of bubble sort written in c
PPT
COMPUTER PROGRAMMING UNIT 1 Lecture 5
PPTX
Data structure presentation sorting
PDF
#include algorithm #include vector #include iostream usi.pdf
DSA.pdf
Unit6 C
Write a complete C programme to implement the following sorting algor.docx
Program of sorting using shell sort #include stdio.h #de.pdf
DAA Lab Work.docx
Data Structure in C (Lab Programs)
Data Structures Using C Practical File
Sortings
C Language Unit-6
Assignment
Unit6 jwfiles
Ds program-print
Daapracticals 111105084852-phpapp02
Hi,Please fidn the Answer.Sorting,h is Header .pdf
An example of bubble sort written in c
COMPUTER PROGRAMMING UNIT 1 Lecture 5
Data structure presentation sorting
#include algorithm #include vector #include iostream usi.pdf
Ad

More from apnafreez (20)

PDF
Cu(H2O)42+(aq) + 4CN-(aq) = Cu(CN)42-(aq) +4 H2O(l)Cu+2 is a Lew.pdf
PDF
C) CS2 for sureA, B, D and E are all ionic compoundsSolution.pdf
PDF
Before getting public issues he should consider are 1. Increase i.pdf
PDF
Assets=Liabilities+Stockholders EquityCash given $1000 on the sa.pdf
PDF
1)Interest per year 8106= 135Simple interest = Amount RateTime.pdf
PDF
AnswerAnswer1. The body of a fungus is in the form of solid sh.pdf
PDF
A. This constitutes part of a gene that encodes information for RNA .pdf
PDF
A. ANSAutosomal dominant (a trait could passed down from previous.pdf
PDF
18) One device is attached to a physical interface    The switch c.pdf
PDF
1.Joseph could not restrain himself before all those who stood by hi.pdf
PDF
(a) Total amount of I2 = 501000 x 0.010 = 0.0005 mol = 0.5 mmolLe.pdf
PDF
Nursing is a healthcare profession in which they serve the patients .pdf
PDF
yes.because the deposted money can be multiply with 10 and it beco.pdf
PDF
When the substituent groups are oriented in the s.pdf
PDF
using System;public category take a look at one.00m; Console.W.pdf
PDF
Tunnel through the IPv4--Internet traffic is expected to be carr.pdf
PDF
The sum is 250.SolutionThe sum is 250..pdf
PDF
The  key activity areas for securities firms are i. Investing Se.pdf
PDF
The finger like projections of intestine known as villi increases su.pdf
PDF
The answer isC. 12In establishing paternity by dna fingerprintin.pdf
Cu(H2O)42+(aq) + 4CN-(aq) = Cu(CN)42-(aq) +4 H2O(l)Cu+2 is a Lew.pdf
C) CS2 for sureA, B, D and E are all ionic compoundsSolution.pdf
Before getting public issues he should consider are 1. Increase i.pdf
Assets=Liabilities+Stockholders EquityCash given $1000 on the sa.pdf
1)Interest per year 8106= 135Simple interest = Amount RateTime.pdf
AnswerAnswer1. The body of a fungus is in the form of solid sh.pdf
A. This constitutes part of a gene that encodes information for RNA .pdf
A. ANSAutosomal dominant (a trait could passed down from previous.pdf
18) One device is attached to a physical interface    The switch c.pdf
1.Joseph could not restrain himself before all those who stood by hi.pdf
(a) Total amount of I2 = 501000 x 0.010 = 0.0005 mol = 0.5 mmolLe.pdf
Nursing is a healthcare profession in which they serve the patients .pdf
yes.because the deposted money can be multiply with 10 and it beco.pdf
When the substituent groups are oriented in the s.pdf
using System;public category take a look at one.00m; Console.W.pdf
Tunnel through the IPv4--Internet traffic is expected to be carr.pdf
The sum is 250.SolutionThe sum is 250..pdf
The  key activity areas for securities firms are i. Investing Se.pdf
The finger like projections of intestine known as villi increases su.pdf
The answer isC. 12In establishing paternity by dna fingerprintin.pdf
Ad

Recently uploaded (20)

PDF
Classroom Observation Tools for Teachers
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Cell Types and Its function , kingdom of life
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Insiders guide to clinical Medicine.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Sports Quiz easy sports quiz sports quiz
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
RMMM.pdf make it easy to upload and study
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
PPH.pptx obstetrics and gynecology in nursing
Classroom Observation Tools for Teachers
FourierSeries-QuestionsWithAnswers(Part-A).pdf
VCE English Exam - Section C Student Revision Booklet
Cell Types and Its function , kingdom of life
102 student loan defaulters named and shamed – Is someone you know on the list?
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
O7-L3 Supply Chain Operations - ICLT Program
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Insiders guide to clinical Medicine.pdf
Anesthesia in Laparoscopic Surgery in India
Sports Quiz easy sports quiz sports quiz
O5-L3 Freight Transport Ops (International) V1.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
GDM (1) (1).pptx small presentation for students
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
RMMM.pdf make it easy to upload and study
human mycosis Human fungal infections are called human mycosis..pptx
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPH.pptx obstetrics and gynecology in nursing

888678123317368915236 #include stdio.h #include stdlib.h.pdf

  • 1. 8886781233 17368915236 #include #include int main() { int i, n, *data , p; /* get the number of inputs from the user */ printf("Enter the number of inputs:"); scanf("%d", &n); /* dynamically allocate memory to store i/p values */ data = (int *) malloc(sizeof(int) * n); /* get the input data from the user */ for (i = 0; i < n; i++) { printf("data[%d]: ", i); scanf("%d", &data[i]); } /* sorts the given numbers */ bubbleSort(data, n ,p ); } void bubbleSort(int *data, int n , int p) { int i, temp, k = 1, l,j; if (n > 0) { for (i = n; i > 0; i--) { if (data[i] > data[i - 1]) { temp = data[i]; data[i] = data[i - 1]; data[i - 1] = temp; } if( p = = 0) { p++;
  • 2. l = n; for ( i = 0 ; i < n ; i++) { prinft ( %d, data[i]) } bubbleSort(data, i - 2 , p ); } else { for ( j = n - 1 ; j < l ; j++) { if (data[j] > data[j - 1]) { temp = data[j]; data[j] = data[j - 1]; data[j - 1] = temp; } } for ( j = 0 ; j < l ; j++) { prinft ( %d, data[j]) } bubbleSort(data, i - 2,p); } } } return; } Solution 8886781233
  • 3. 17368915236 #include #include int main() { int i, n, *data , p; /* get the number of inputs from the user */ printf("Enter the number of inputs:"); scanf("%d", &n); /* dynamically allocate memory to store i/p values */ data = (int *) malloc(sizeof(int) * n); /* get the input data from the user */ for (i = 0; i < n; i++) { printf("data[%d]: ", i); scanf("%d", &data[i]); } /* sorts the given numbers */ bubbleSort(data, n ,p ); } void bubbleSort(int *data, int n , int p) { int i, temp, k = 1, l,j; if (n > 0) { for (i = n; i > 0; i--) { if (data[i] > data[i - 1]) { temp = data[i]; data[i] = data[i - 1]; data[i - 1] = temp; } if( p = = 0) { p++; l = n; for ( i = 0 ; i < n ; i++)
  • 4. { prinft ( %d, data[i]) } bubbleSort(data, i - 2 , p ); } else { for ( j = n - 1 ; j < l ; j++) { if (data[j] > data[j - 1]) { temp = data[j]; data[j] = data[j - 1]; data[j - 1] = temp; } } for ( j = 0 ; j < l ; j++) { prinft ( %d, data[j]) } bubbleSort(data, i - 2,p); } } } return; }