SlideShare a Scribd company logo
s1-2
#include <stdio.h>
#include <conio.h>
#include <string.h>
void main()
{
char str[10][20],t[20];
int i,j;
clrscr();
printf("Enter the 10 strings :n");
for(i=0;i<10;++i)
gets(str[i]);
for(i=0;i<9;++i)
for(j=i+1;j<10;++j)
if(strcmp(str[i],str[j]) > 0)
{
strcpy(t,str[i]);
strcpy(str[i],str[j]);
strcpy(str[j],t);
}
printf("The strings in lexicographical order is :n");
for(i=0;i<10;++i)
printf("%sn",str[i]);
getch();
}
Page 1
Ad

More Related Content

What's hot (20)

Scanfill polygon
Scanfill polygonScanfill polygon
Scanfill polygon
Sonia Pahuja
 
listing output program C
listing output program Clisting output program C
listing output program C
AdjievanGestu
 
Alocação Dinâmica em C
Alocação Dinâmica em CAlocação Dinâmica em C
Alocação Dinâmica em C
Luiz Francisco Bozo
 
Program to remove Left factoring
Program to remove Left factoringProgram to remove Left factoring
Program to remove Left factoring
Shraddha Patel
 
Bubble sort
Bubble sortBubble sort
Bubble sort
Hitesh Kumar
 
contoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi forcontoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi for
M Fahmi Ansori
 
Heep implementation in c
Heep implementation in cHeep implementation in c
Heep implementation in c
HapPy SumOn
 
Sujet bac info 2012 g1, g2 et g3 avec correction
Sujet bac info 2012 g1, g2 et g3 avec correctionSujet bac info 2012 g1, g2 et g3 avec correction
Sujet bac info 2012 g1, g2 et g3 avec correction
borhen boukthir
 
Practica 4 errores
Practica 4 erroresPractica 4 errores
Practica 4 errores
UVM
 
Ejercicios.
Ejercicios. Ejercicios.
Ejercicios.
Jose Dani
 
Pilas
PilasPilas
Pilas
Cerdorock
 
vecotores programacion
vecotores programacionvecotores programacion
vecotores programacion
Alex Flores Avalos
 
Linker
LinkerLinker
Linker
Satyamevjayte Haxor
 

Viewers also liked (8)

Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3
Dr. Loganathan R
 
Academic counselling in IGNOU S.Kishore
Academic counselling  in IGNOU S.KishoreAcademic counselling  in IGNOU S.Kishore
Academic counselling in IGNOU S.Kishore
skishoredr1
 
Mcs 021 solve assignment
Mcs 021 solve assignmentMcs 021 solve assignment
Mcs 021 solve assignment
Indira Gnadhi National Open University (IGNOU)
 
IgnouBCA
IgnouBCAIgnouBCA
IgnouBCA
diwakar9903
 
bank transaction system
bank transaction systembank transaction system
bank transaction system
Bhavika Pathak
 
Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4Bcsl 033 data and file structures lab s1-4
Bcsl 033 data and file structures lab s1-4
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1Bcsl 033 data and file structures lab s1-1
Bcsl 033 data and file structures lab s1-1
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2Bcsl 033 data and file structures lab s3-2
Bcsl 033 data and file structures lab s3-2
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3Bcsl 033 data and file structures lab s1-3
Bcsl 033 data and file structures lab s1-3
Dr. Loganathan R
 
Academic counselling in IGNOU S.Kishore
Academic counselling  in IGNOU S.KishoreAcademic counselling  in IGNOU S.Kishore
Academic counselling in IGNOU S.Kishore
skishoredr1
 
bank transaction system
bank transaction systembank transaction system
bank transaction system
Bhavika Pathak
 
Ad

More from Dr. Loganathan R (20)

Ch 6 IoT Processing Topologies and Types.pdf
Ch 6 IoT Processing Topologies and Types.pdfCh 6 IoT Processing Topologies and Types.pdf
Ch 6 IoT Processing Topologies and Types.pdf
Dr. Loganathan R
 
IoT Sensing and Actuation.pdf
 IoT Sensing and Actuation.pdf IoT Sensing and Actuation.pdf
IoT Sensing and Actuation.pdf
Dr. Loganathan R
 
Ch 4 Emergence of IoT.pdf
Ch 4 Emergence of IoT.pdfCh 4 Emergence of IoT.pdf
Ch 4 Emergence of IoT.pdf
Dr. Loganathan R
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
Dr. Loganathan R
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1
Dr. Loganathan R
 
Introduction to Information Security
Introduction to Information SecurityIntroduction to Information Security
Introduction to Information Security
Dr. Loganathan R
 
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Dr. Loganathan R
 
Session 9 4 alp to display the current system time using dos int 21 h
Session 9  4 alp to display the current system time using dos int 21 hSession 9  4 alp to display the current system time using dos int 21 h
Session 9 4 alp to display the current system time using dos int 21 h
Dr. Loganathan R
 
Session 9 1 alp to compute a grade using procedures
Session 9   1 alp to compute a grade using proceduresSession 9   1 alp to compute a grade using procedures
Session 9 1 alp to compute a grade using procedures
Dr. Loganathan R
 
IGNOU Assembly Language Programming
IGNOU Assembly Language ProgrammingIGNOU Assembly Language Programming
IGNOU Assembly Language Programming
Dr. Loganathan R
 
Requirement engineering process
Requirement engineering processRequirement engineering process
Requirement engineering process
Dr. Loganathan R
 
MCS 012 computer organisation and assembly language programming assignment…
MCS 012 computer organisation and assembly language programming assignment…MCS 012 computer organisation and assembly language programming assignment…
MCS 012 computer organisation and assembly language programming assignment…
Dr. Loganathan R
 
Ch 6 IoT Processing Topologies and Types.pdf
Ch 6 IoT Processing Topologies and Types.pdfCh 6 IoT Processing Topologies and Types.pdf
Ch 6 IoT Processing Topologies and Types.pdf
Dr. Loganathan R
 
IoT Sensing and Actuation.pdf
 IoT Sensing and Actuation.pdf IoT Sensing and Actuation.pdf
IoT Sensing and Actuation.pdf
Dr. Loganathan R
 
Program in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointersProgram in ‘C’ language to implement linear search using pointers
Program in ‘C’ language to implement linear search using pointers
Dr. Loganathan R
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3Bcsl 033 data and file structures lab s5-3
Bcsl 033 data and file structures lab s5-3
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2Bcsl 033 data and file structures lab s5-2
Bcsl 033 data and file structures lab s5-2
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2Bcsl 033 data and file structures lab s4-2
Bcsl 033 data and file structures lab s4-2
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3Bcsl 033 data and file structures lab s3-3
Bcsl 033 data and file structures lab s3-3
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1Bcsl 033 data and file structures lab s3-1
Bcsl 033 data and file structures lab s3-1
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3Bcsl 033 data and file structures lab s2-3
Bcsl 033 data and file structures lab s2-3
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2Bcsl 033 data and file structures lab s2-2
Bcsl 033 data and file structures lab s2-2
Dr. Loganathan R
 
Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1Bcsl 033 data and file structures lab s2-1
Bcsl 033 data and file structures lab s2-1
Dr. Loganathan R
 
Introduction to Information Security
Introduction to Information SecurityIntroduction to Information Security
Introduction to Information Security
Dr. Loganathan R
 
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...Mcs 012 computer organisation and assemly language programming- ignou assignm...
Mcs 012 computer organisation and assemly language programming- ignou assignm...
Dr. Loganathan R
 
Session 9 4 alp to display the current system time using dos int 21 h
Session 9  4 alp to display the current system time using dos int 21 hSession 9  4 alp to display the current system time using dos int 21 h
Session 9 4 alp to display the current system time using dos int 21 h
Dr. Loganathan R
 
Session 9 1 alp to compute a grade using procedures
Session 9   1 alp to compute a grade using proceduresSession 9   1 alp to compute a grade using procedures
Session 9 1 alp to compute a grade using procedures
Dr. Loganathan R
 
IGNOU Assembly Language Programming
IGNOU Assembly Language ProgrammingIGNOU Assembly Language Programming
IGNOU Assembly Language Programming
Dr. Loganathan R
 
Requirement engineering process
Requirement engineering processRequirement engineering process
Requirement engineering process
Dr. Loganathan R
 
MCS 012 computer organisation and assembly language programming assignment…
MCS 012 computer organisation and assembly language programming assignment…MCS 012 computer organisation and assembly language programming assignment…
MCS 012 computer organisation and assembly language programming assignment…
Dr. Loganathan R
 
Ad

Recently uploaded (10)

зүүн бүс зүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүс
зүүн бүс зүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүс зүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүс
зүүн бүс зүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүс
Mr Nyak
 
POLIEDRO. Redaçãoooooooooooooooooooo.pdf
POLIEDRO. Redaçãoooooooooooooooooooo.pdfPOLIEDRO. Redaçãoooooooooooooooooooo.pdf
POLIEDRO. Redaçãoooooooooooooooooooo.pdf
ElineideFernandes2
 
سيرة حياة الشيخ عبد اللطيف خضر الصوفي.pdf
سيرة حياة الشيخ عبد اللطيف خضر الصوفي.pdfسيرة حياة الشيخ عبد اللطيف خضر الصوفي.pdf
سيرة حياة الشيخ عبد اللطيف خضر الصوفي.pdf
nhnh918591
 
Oral Surgery_ Condylar Fractures.pdfhdjdiidkkdkd
Oral Surgery_ Condylar Fractures.pdfhdjdiidkkdkdOral Surgery_ Condylar Fractures.pdfhdjdiidkkdkd
Oral Surgery_ Condylar Fractures.pdfhdjdiidkkdkd
drsanidads25
 
مدخل إلى تسيير المخاطر-تسيير المخاطر.pptx
مدخل إلى تسيير المخاطر-تسيير المخاطر.pptxمدخل إلى تسيير المخاطر-تسيير المخاطر.pptx
مدخل إلى تسيير المخاطر-تسيير المخاطر.pptx
nesda1
 
MODEL KAMPUNG TEMATIK ECO-ENZYME DI DESA BATU BELAH 27 juli 2023.pptx
MODEL KAMPUNG TEMATIK ECO-ENZYME DI DESA BATU BELAH 27 juli 2023.pptxMODEL KAMPUNG TEMATIK ECO-ENZYME DI DESA BATU BELAH 27 juli 2023.pptx
MODEL KAMPUNG TEMATIK ECO-ENZYME DI DESA BATU BELAH 27 juli 2023.pptx
chairul39
 
2.haji gelombang 2 tingkat Kabupaten Mojokerto.pptx
2.haji gelombang 2 tingkat Kabupaten Mojokerto.pptx2.haji gelombang 2 tingkat Kabupaten Mojokerto.pptx
2.haji gelombang 2 tingkat Kabupaten Mojokerto.pptx
stkhoiriyah0701
 
Argumentarea vanzarii
Argumentarea vanzariiArgumentarea vanzarii
Argumentarea vanzarii
Rodica B
 
متشابهات_سورة_الرعد_مع_نفسها_وما_قبلها.pdf
متشابهات_سورة_الرعد_مع_نفسها_وما_قبلها.pdfمتشابهات_سورة_الرعد_مع_نفسها_وما_قبلها.pdf
متشابهات_سورة_الرعد_مع_نفسها_وما_قبلها.pdf
Qalb Salim T'alim Qur'an
 
Rapat Persiapan Pelaksanaan Pembangunan DKK.pptx
Rapat Persiapan Pelaksanaan Pembangunan DKK.pptxRapat Persiapan Pelaksanaan Pembangunan DKK.pptx
Rapat Persiapan Pelaksanaan Pembangunan DKK.pptx
hongkyandres01
 
зүүн бүс зүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүс
зүүн бүс зүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүс зүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүс
зүүн бүс зүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүсзүүн бүс
Mr Nyak
 
POLIEDRO. Redaçãoooooooooooooooooooo.pdf
POLIEDRO. Redaçãoooooooooooooooooooo.pdfPOLIEDRO. Redaçãoooooooooooooooooooo.pdf
POLIEDRO. Redaçãoooooooooooooooooooo.pdf
ElineideFernandes2
 
سيرة حياة الشيخ عبد اللطيف خضر الصوفي.pdf
سيرة حياة الشيخ عبد اللطيف خضر الصوفي.pdfسيرة حياة الشيخ عبد اللطيف خضر الصوفي.pdf
سيرة حياة الشيخ عبد اللطيف خضر الصوفي.pdf
nhnh918591
 
Oral Surgery_ Condylar Fractures.pdfhdjdiidkkdkd
Oral Surgery_ Condylar Fractures.pdfhdjdiidkkdkdOral Surgery_ Condylar Fractures.pdfhdjdiidkkdkd
Oral Surgery_ Condylar Fractures.pdfhdjdiidkkdkd
drsanidads25
 
مدخل إلى تسيير المخاطر-تسيير المخاطر.pptx
مدخل إلى تسيير المخاطر-تسيير المخاطر.pptxمدخل إلى تسيير المخاطر-تسيير المخاطر.pptx
مدخل إلى تسيير المخاطر-تسيير المخاطر.pptx
nesda1
 
MODEL KAMPUNG TEMATIK ECO-ENZYME DI DESA BATU BELAH 27 juli 2023.pptx
MODEL KAMPUNG TEMATIK ECO-ENZYME DI DESA BATU BELAH 27 juli 2023.pptxMODEL KAMPUNG TEMATIK ECO-ENZYME DI DESA BATU BELAH 27 juli 2023.pptx
MODEL KAMPUNG TEMATIK ECO-ENZYME DI DESA BATU BELAH 27 juli 2023.pptx
chairul39
 
2.haji gelombang 2 tingkat Kabupaten Mojokerto.pptx
2.haji gelombang 2 tingkat Kabupaten Mojokerto.pptx2.haji gelombang 2 tingkat Kabupaten Mojokerto.pptx
2.haji gelombang 2 tingkat Kabupaten Mojokerto.pptx
stkhoiriyah0701
 
Argumentarea vanzarii
Argumentarea vanzariiArgumentarea vanzarii
Argumentarea vanzarii
Rodica B
 
متشابهات_سورة_الرعد_مع_نفسها_وما_قبلها.pdf
متشابهات_سورة_الرعد_مع_نفسها_وما_قبلها.pdfمتشابهات_سورة_الرعد_مع_نفسها_وما_قبلها.pdf
متشابهات_سورة_الرعد_مع_نفسها_وما_قبلها.pdf
Qalb Salim T'alim Qur'an
 
Rapat Persiapan Pelaksanaan Pembangunan DKK.pptx
Rapat Persiapan Pelaksanaan Pembangunan DKK.pptxRapat Persiapan Pelaksanaan Pembangunan DKK.pptx
Rapat Persiapan Pelaksanaan Pembangunan DKK.pptx
hongkyandres01
 

Bcsl 033 data and file structures lab s1-2

  • 1. s1-2 #include <stdio.h> #include <conio.h> #include <string.h> void main() { char str[10][20],t[20]; int i,j; clrscr(); printf("Enter the 10 strings :n"); for(i=0;i<10;++i) gets(str[i]); for(i=0;i<9;++i) for(j=i+1;j<10;++j) if(strcmp(str[i],str[j]) > 0) { strcpy(t,str[i]); strcpy(str[i],str[j]); strcpy(str[j],t); } printf("The strings in lexicographical order is :n"); for(i=0;i<10;++i) printf("%sn",str[i]); getch(); } Page 1