SlideShare a Scribd company logo
int main()
{
int a[10],i,n,j,t;
printf("ENTER THE SIZE OF LIST:");
scanf("%d",&n);
printf("ENTER THE ELEMENTS:");
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
for(j=i+1;j<n;j++)
{
if(a[i]>a[j])
{
t=a[i];
a[i]=a[j];
a[j]=t;
}
}
}
printf("n the sorted list in ascending ordern");
for(i=0;i<n;i++)
{
printf("%dn",a[i]);
}
}
#include <stdio.h>
#include <string.h>
void main()
{
char name[10][8], tname[10][8], temp[8];
int i, j, n;
printf("Enter the value of n n");
scanf("%d", &n);
printf("Enter %d names n", n);
for (i = 0; i < n; i++)
{
scanf("%s", name[i]);
strcpy(tname[i], name[i]);
}
for (i = 0; i < n - 1 ; i++)
{
for (j = i + 1; j < n; j++)
{
if (strcmp(name[i], name[j]) > 0)
{
strcpy(temp, name[i]);
strcpy(name[i], name[j]);
strcpy(name[j], temp);
}
}
}
printf("n----------------------------------------n");
printf("Input NamestSorted namesn");
printf("------------------------------------------n");
for (i = 0; i < n; i++)
{
printf("%stt%sn", tname[i], name[i]);
}
printf("------------------------------------------n");
}

More Related Content

What's hot

N primo clase programa
N primo clase programaN primo clase programa
N primo clase programa
Leydyca Leydyca
 
Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2
Dr. Loganathan R
 
Scanfill polygon
Scanfill polygonScanfill polygon
Scanfill polygon
Sonia Pahuja
 
Ooprc3a
Ooprc3aOoprc3a
Ooprc3a
Ankit Dubey
 
Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3
Dr. Loganathan R
 
Quick sort
Quick sortQuick sort
Quick sort
Hitesh Kumar
 
[程式設計]標準差
[程式設計]標準差[程式設計]標準差
[程式設計]標準差
Hui-Shih Leng
 
Infitopost notepad
Infitopost   notepadInfitopost   notepad
Infitopost notepadAnand Kumar
 
Ejercicios.
Ejercicios. Ejercicios.
Ejercicios.
Jose Dani
 
Fcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt ChartFcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt Chart
One97 Communications Limited
 
Bai lam chuong 3
Bai lam chuong 3Bai lam chuong 3
Bai lam chuong 3tran thai
 
Sum2
Sum2Sum2
Sources
SourcesSources
Sourcesyonsei
 
Program to remove Left factoring
Program to remove Left factoringProgram to remove Left factoring
Program to remove Left factoring
Shraddha Patel
 
16067 array programs
16067 array programs16067 array programs
16067 array programs
researchict
 
C언어 스터디 강의자료 - 3차시
C언어 스터디 강의자료 - 3차시C언어 스터디 강의자료 - 3차시
C언어 스터디 강의자료 - 3차시
Junha Jang
 

What's hot (20)

N primo clase programa
N primo clase programaN primo clase programa
N primo clase programa
 
B.f.s
B.f.sB.f.s
B.f.s
 
Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2Bcsl 033 data and file structures lab s1-2
Bcsl 033 data and file structures lab s1-2
 
Scanfill polygon
Scanfill polygonScanfill polygon
Scanfill polygon
 
Ooprc3a
Ooprc3aOoprc3a
Ooprc3a
 
Union
UnionUnion
Union
 
Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3
 
Quick sort
Quick sortQuick sort
Quick sort
 
[程式設計]標準差
[程式設計]標準差[程式設計]標準差
[程式設計]標準差
 
Infitopost notepad
Infitopost   notepadInfitopost   notepad
Infitopost notepad
 
Ejercicios.
Ejercicios. Ejercicios.
Ejercicios.
 
Selection
SelectionSelection
Selection
 
Ds program
Ds programDs program
Ds program
 
Fcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt ChartFcfs Cpu Scheduling With Gantt Chart
Fcfs Cpu Scheduling With Gantt Chart
 
Bai lam chuong 3
Bai lam chuong 3Bai lam chuong 3
Bai lam chuong 3
 
Sum2
Sum2Sum2
Sum2
 
Sources
SourcesSources
Sources
 
Program to remove Left factoring
Program to remove Left factoringProgram to remove Left factoring
Program to remove Left factoring
 
16067 array programs
16067 array programs16067 array programs
16067 array programs
 
C언어 스터디 강의자료 - 3차시
C언어 스터디 강의자료 - 3차시C언어 스터디 강의자료 - 3차시
C언어 스터디 강의자료 - 3차시
 

Viewers also liked

Amplifier Design
Amplifier DesignAmplifier Design
Amplifier Design
imranbashir
 
Desde la sociedad excluyente a la escuela inclusiva
Desde la sociedad excluyente a la escuela inclusivaDesde la sociedad excluyente a la escuela inclusiva
Desde la sociedad excluyente a la escuela inclusiva
Alondra Origel Leon
 
Turkey_AFAD_2016
Turkey_AFAD_2016Turkey_AFAD_2016
Turkey_AFAD_2016
Nathali Lehmann Hirsch
 
Fall Simmer Pot Recipes
Fall Simmer Pot RecipesFall Simmer Pot Recipes
Fall Simmer Pot Recipes
MaidPro Kansas City
 
Викторина Е.Шварц "Сказка о потерянном времени"
Викторина Е.Шварц "Сказка о потерянном времени"Викторина Е.Шварц "Сказка о потерянном времени"
Викторина Е.Шварц "Сказка о потерянном времени"
Лапардина Ольга
 
myTaxi - NOAH12 London
myTaxi - NOAH12 LondonmyTaxi - NOAH12 London
myTaxi - NOAH12 London
Marco Rodzynek
 
Circles ed tfinal
Circles ed tfinalCircles ed tfinal
Circles ed tfinal
reshmashhh
 
Samsung Eternity Promotional Campaign
Samsung Eternity Promotional CampaignSamsung Eternity Promotional Campaign
Samsung Eternity Promotional Campaign
ctd2010
 
Edge Tx With Mitigation Of Osc Pulling
Edge Tx With Mitigation Of Osc PullingEdge Tx With Mitigation Of Osc Pulling
Edge Tx With Mitigation Of Osc Pulling
imranbashir
 
Perforce Setup
Perforce SetupPerforce Setup
Perforce Setup
imranbashir
 
¿Como elaborar jabón?
¿Como elaborar jabón?¿Como elaborar jabón?
¿Como elaborar jabón?
enderminion4377
 
#Instagram API Get visibility you always wanted
#Instagram API   Get visibility you always wanted#Instagram API   Get visibility you always wanted
#Instagram API Get visibility you always wanted
Ketan Raval
 
On Chip Calibration And Compensation Techniques (11 03 08)
On Chip Calibration And Compensation Techniques (11 03 08)On Chip Calibration And Compensation Techniques (11 03 08)
On Chip Calibration And Compensation Techniques (11 03 08)
imranbashir
 
IoT and Future of Connected world
IoT and Future of Connected worldIoT and Future of Connected world
IoT and Future of Connected world
Ketan Raval
 
Bizz box – the e networking hub
Bizz box – the e networking hubBizz box – the e networking hub
Bizz box – the e networking hub
Danny Gaethofs
 
Hadith
HadithHadith
Master plan 2031 faridabad
Master plan 2031 faridabadMaster plan 2031 faridabad
Master plan 2031 faridabad
Green Realtech Projects Pvt. Ltd
 
Noida master plan 2031
Noida master plan 2031Noida master plan 2031
Noida master plan 2031
Green Realtech Projects Pvt. Ltd
 
The Power of TLC: Technology + Learning + Creativity
The Power of TLC: Technology + Learning + CreativityThe Power of TLC: Technology + Learning + Creativity
The Power of TLC: Technology + Learning + Creativity
Karen Bosch
 
a glimp into the future of electronic invoicing
a glimp into the future of electronic invoicinga glimp into the future of electronic invoicing
a glimp into the future of electronic invoicing
Danny Gaethofs
 

Viewers also liked (20)

Amplifier Design
Amplifier DesignAmplifier Design
Amplifier Design
 
Desde la sociedad excluyente a la escuela inclusiva
Desde la sociedad excluyente a la escuela inclusivaDesde la sociedad excluyente a la escuela inclusiva
Desde la sociedad excluyente a la escuela inclusiva
 
Turkey_AFAD_2016
Turkey_AFAD_2016Turkey_AFAD_2016
Turkey_AFAD_2016
 
Fall Simmer Pot Recipes
Fall Simmer Pot RecipesFall Simmer Pot Recipes
Fall Simmer Pot Recipes
 
Викторина Е.Шварц "Сказка о потерянном времени"
Викторина Е.Шварц "Сказка о потерянном времени"Викторина Е.Шварц "Сказка о потерянном времени"
Викторина Е.Шварц "Сказка о потерянном времени"
 
myTaxi - NOAH12 London
myTaxi - NOAH12 LondonmyTaxi - NOAH12 London
myTaxi - NOAH12 London
 
Circles ed tfinal
Circles ed tfinalCircles ed tfinal
Circles ed tfinal
 
Samsung Eternity Promotional Campaign
Samsung Eternity Promotional CampaignSamsung Eternity Promotional Campaign
Samsung Eternity Promotional Campaign
 
Edge Tx With Mitigation Of Osc Pulling
Edge Tx With Mitigation Of Osc PullingEdge Tx With Mitigation Of Osc Pulling
Edge Tx With Mitigation Of Osc Pulling
 
Perforce Setup
Perforce SetupPerforce Setup
Perforce Setup
 
¿Como elaborar jabón?
¿Como elaborar jabón?¿Como elaborar jabón?
¿Como elaborar jabón?
 
#Instagram API Get visibility you always wanted
#Instagram API   Get visibility you always wanted#Instagram API   Get visibility you always wanted
#Instagram API Get visibility you always wanted
 
On Chip Calibration And Compensation Techniques (11 03 08)
On Chip Calibration And Compensation Techniques (11 03 08)On Chip Calibration And Compensation Techniques (11 03 08)
On Chip Calibration And Compensation Techniques (11 03 08)
 
IoT and Future of Connected world
IoT and Future of Connected worldIoT and Future of Connected world
IoT and Future of Connected world
 
Bizz box – the e networking hub
Bizz box – the e networking hubBizz box – the e networking hub
Bizz box – the e networking hub
 
Hadith
HadithHadith
Hadith
 
Master plan 2031 faridabad
Master plan 2031 faridabadMaster plan 2031 faridabad
Master plan 2031 faridabad
 
Noida master plan 2031
Noida master plan 2031Noida master plan 2031
Noida master plan 2031
 
The Power of TLC: Technology + Learning + Creativity
The Power of TLC: Technology + Learning + CreativityThe Power of TLC: Technology + Learning + Creativity
The Power of TLC: Technology + Learning + Creativity
 
a glimp into the future of electronic invoicing
a glimp into the future of electronic invoicinga glimp into the future of electronic invoicing
a glimp into the future of electronic invoicing
 

Cpro

  • 1. int main() { int a[10],i,n,j,t; printf("ENTER THE SIZE OF LIST:"); scanf("%d",&n); printf("ENTER THE ELEMENTS:"); for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(a[i]>a[j]) { t=a[i]; a[i]=a[j]; a[j]=t; } } } printf("n the sorted list in ascending ordern"); for(i=0;i<n;i++) { printf("%dn",a[i]); } } #include <stdio.h> #include <string.h> void main() { char name[10][8], tname[10][8], temp[8]; int i, j, n; printf("Enter the value of n n"); scanf("%d", &n); printf("Enter %d names n", n); for (i = 0; i < n; i++) { scanf("%s", name[i]); strcpy(tname[i], name[i]); } for (i = 0; i < n - 1 ; i++) { for (j = i + 1; j < n; j++) { if (strcmp(name[i], name[j]) > 0) { strcpy(temp, name[i]); strcpy(name[i], name[j]); strcpy(name[j], temp); } } } printf("n----------------------------------------n"); printf("Input NamestSorted namesn"); printf("------------------------------------------n"); for (i = 0; i < n; i++)