write a program to sort the elements in a given array in c
language
Answer Posted / bhagya
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5];
int i,j=0;
printf("enter 5 values into the array a");
for(i=0;i<5;i++)
{
scanf("%d",&a[i]);
}
printf("the sorted order of elements");
for(i=0;i<5;i++)
{ t=a[i];
for(j=0;j<5;j++)
{
if(a[i]>a[j])
a[i]=a[j];
a[j]=t;
}
}
}
| Is This Answer Correct ? | 144 Yes | 123 No |
Post New Answer View All Answers
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
Explain what are linked list?
what are the different storage classes in c?
Explain what is wrong with this statement? Myname = ?robin?;
Sir i need notes for structure,functions,pointers in c language can you help me please
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
Which programming language is best for getting job 2020?
The __________ attribute is used to announce variables based on definitions of columns in a table?
What is meant by gets in c?
What is advantage of pointer in c?
What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }
What are derived data types in c?
please can any one suggest me best useful video tutorials on c i am science graduate.please help me.u can email me to sas29@in.com
What does calloc stand for?
What are bitwise shift operators in c programming?