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
Where are the auto variables stored?
Describe the header file and its usage in c programming?
what is the difference between 123 and 0123 in c?
What are the features of the c language?
Is file a keyword in c?
What is the code for 3 questions and answer check in VisualBasic.Net?
Differentiate fundamental data types and derived data types in C.
What is array in c with example?
the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function
Can a void pointer point to a function?
Can we declare variables anywhere in c?
Can the sizeof operator be used to tell the size of an array passed to a function?
When should we use pointers in a c program?
pierrot's divisor program using c or c++ code
What are the data types present in c?