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
What is the meaning of && in c?
What is a good data structure to use for storing lines of text?
How can you draw circles in C?
What are high level languages like C and FORTRAN also known as?
What is void main () in c?
show how link list can be used to repersent the following polynomial i) 5x+2
What is the size of structure pointer in c?
Write a program to identify if a given binary tree is balanced or not.
Explain what is page thrashing?
I have a varargs function which accepts a float parameter?
What is p in text message?
What are the ways to a null pointer can use in c programming language?
What is external variable in c?
What is the purpose of sprintf() function?
Explain main function in c?