write a program to sort the elements in a given array in c
language
Answer Posted / yoyo
#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]=t;
a[i]=a[j];
a[j]=t;
}
}
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
write a program to print data of 5 five students with structures?
Write a C program to count the number of email on text
What is the difference between āgā and āgā in C?
Tell me with an example the self-referential structure?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
What is quick sort in c?
how do you execute a c program in unix.
What is the function of this pointer?
which is an algorithm for sorting in a growing Lexicographic order
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
how to count no of words,characters,lines in a paragraph.
In a switch statement, what will happen if a break statement is omitted?
Explain what is the difference between text files and binary files?
How many levels of pointers can you have?
How is a structure member accessed?