write a program to sort the elements in a given array in c
language
Answer Posted / naga tirupathi rao
#include<stdio.h>
#include<conio.h>
main()
{
int a[25],i,n,sum=0;
clrscr();
prinf("enter the size of array");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
printf("element%d=",i);
scanf("%d",&a[i]);
sum=sum+a[i];
}
printf("ascending orderis:");
for(j=0;j<=sum;j++)
{
for(i=1;i<=n;i++)
{
if(j==a[i])
printf("%d",j);
}
}
getch();
}
| Is This Answer Correct ? | 22 Yes | 15 No |
Post New Answer View All Answers
how to count no of words,characters,lines in a paragraph.
Which are low level languages?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
Why flag is used in c?
What is the difference between arrays and pointers?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
What is far pointer in c?
What is modeling?
Is it possible to initialize a variable at the time it was declared?
What does the file stdio.h contain?
How do I get an accurate error status return from system on ms-dos?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is the role of this pointer?
what is a function method?give example?
How do you view the path?