SlideShare a Scribd company logo
1 of 1
Download to read offline
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

More Related Content

What's hot (20)

B.f.s
B.f.sB.f.s
B.f.s
 
質數的判斷
質數的判斷質數的判斷
質數的判斷
 
Scanfill polygon
Scanfill polygonScanfill polygon
Scanfill polygon
 
Union
UnionUnion
Union
 
listing output program C
listing output program Clisting output program C
listing output program C
 
Numeros primos
Numeros primosNumeros primos
Numeros primos
 
Alocação Dinâmica em C
Alocação Dinâmica em CAlocação Dinâmica em C
Alocação Dinâmica em C
 
Program to remove Left factoring
Program to remove Left factoringProgram to remove Left factoring
Program to remove Left factoring
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
contoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi forcontoh Program C++ tentang fungsi for
contoh Program C++ tentang fungsi for
 
Heep implementation in c
Heep implementation in cHeep implementation in c
Heep implementation in c
 
Prueba de montecarlo
Prueba de montecarloPrueba de montecarlo
Prueba de montecarlo
 
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
 
Practica 4 errores
Practica 4 erroresPractica 4 errores
Practica 4 errores
 
Ejercicios.
Ejercicios. Ejercicios.
Ejercicios.
 
week-24x
week-24xweek-24x
week-24x
 
Pilas
PilasPilas
Pilas
 
Trabajo de programacion
Trabajo de programacionTrabajo de programacion
Trabajo de programacion
 
vecotores programacion
vecotores programacionvecotores programacion
vecotores programacion
 
Linker
LinkerLinker
Linker
 

Viewers also liked

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-4Dr. 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-1Dr. 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-2Dr. 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-3Dr. Loganathan R
 
Academic counselling in IGNOU S.Kishore
Academic counselling  in IGNOU S.KishoreAcademic counselling  in IGNOU S.Kishore
Academic counselling in IGNOU S.Kishoreskishoredr1
 
bank transaction system
bank transaction systembank transaction system
bank transaction systemBhavika Pathak
 

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
 
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
 
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
 
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
 
Academic counselling in IGNOU S.Kishore
Academic counselling  in IGNOU S.KishoreAcademic counselling  in IGNOU S.Kishore
Academic counselling in IGNOU S.Kishore
 
Mcs 021 solve assignment
Mcs 021 solve assignmentMcs 021 solve assignment
Mcs 021 solve assignment
 
IgnouBCA
IgnouBCAIgnouBCA
IgnouBCA
 
bank transaction system
bank transaction systembank transaction system
bank transaction system
 

More from 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.pdfDr. Loganathan R
 
IoT Sensing and Actuation.pdf
 IoT Sensing and Actuation.pdf IoT Sensing and Actuation.pdf
IoT Sensing and Actuation.pdfDr. 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 pointersDr. 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-3Dr. 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-2Dr. 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-2Dr. 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-3Dr. 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-1Dr. 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-3Dr. 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-2Dr. 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-1Dr. Loganathan R
 
Introduction to Information Security
Introduction to Information SecurityIntroduction to Information Security
Introduction to Information SecurityDr. 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 hDr. 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 proceduresDr. Loganathan R
 
IGNOU Assembly Language Programming
IGNOU Assembly Language ProgrammingIGNOU Assembly Language Programming
IGNOU Assembly Language ProgrammingDr. Loganathan R
 
Requirement engineering process
Requirement engineering processRequirement engineering process
Requirement engineering processDr. 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
 

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
 
IoT Sensing and Actuation.pdf
 IoT Sensing and Actuation.pdf IoT Sensing and Actuation.pdf
IoT Sensing and Actuation.pdf
 
Ch 4 Emergence of IoT.pdf
Ch 4 Emergence of IoT.pdfCh 4 Emergence of IoT.pdf
Ch 4 Emergence of IoT.pdf
 
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
 
Implement a queue using two stacks.
Implement a queue using two stacks.Implement a queue using two stacks.
Implement a queue using two stacks.
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
Introduction to Information Security
Introduction to Information SecurityIntroduction to Information Security
Introduction to Information Security
 
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...
 
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
 
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
 
IGNOU Assembly Language Programming
IGNOU Assembly Language ProgrammingIGNOU Assembly Language Programming
IGNOU Assembly Language Programming
 
Requirement engineering process
Requirement engineering processRequirement engineering process
Requirement engineering process
 
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…
 

Recently uploaded

Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaranFAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaransekolah233
 
مختصر علم احكام القرآن فقه القرآن وفق منهج العرض
مختصر علم احكام القرآن فقه القرآن وفق منهج العرضمختصر علم احكام القرآن فقه القرآن وفق منهج العرض
مختصر علم احكام القرآن فقه القرآن وفق منهج العرضأنور غني الموسوي
 
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...Nguyen Thanh Tu Collection
 
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 
Bahare Shariat Jild 5 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 5 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 5 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 5 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...Nguyen Thanh Tu Collection
 
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 

Recently uploaded (11)

Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
 
Energy drink .
Energy drink                           .Energy drink                           .
Energy drink .
 
LAR MARIA MÃE DE ÁFRICA .
LAR MARIA MÃE DE ÁFRICA                 .LAR MARIA MÃE DE ÁFRICA                 .
LAR MARIA MÃE DE ÁFRICA .
 
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaranFAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
 
مختصر علم احكام القرآن فقه القرآن وفق منهج العرض
مختصر علم احكام القرآن فقه القرآن وفق منهج العرضمختصر علم احكام القرآن فقه القرآن وفق منهج العرض
مختصر علم احكام القرآن فقه القرآن وفق منهج العرض
 
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
TUYỂN TẬP 25 ĐỀ THI HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2023 CÓ ĐÁP ÁN (SƯU...
 
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
 
Bahare Shariat Jild 5 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 5 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 5 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 5 By SadurshSharia Mufti Amjad Ali Azmi
 
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
TUYỂN TẬP 20 ĐỀ THI KHẢO SÁT HỌC SINH GIỎI MÔN TIẾNG ANH LỚP 6 NĂM 2020 (CÓ Đ...
 
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
 
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
 

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