write a program that accepts 3 numbers from the user. dispaly
the values in a descending order.
Answer Posted / anupama shelke
#include<stdio.h>
#include<conio.h>
main()
{
int a[3],i,j,temp;
clrscr();
for(i=0;i<3;i++)
{
printf("\nEnter the values:");
scanf("%d",&a[i]);
}
for(i=0;i<3;i++)
{
for (j=i+1;j<3;j++)
{
if(a[i]<b[i])
{
temp=a[i];
a[i]=b[i];
b[i]=temp;
}
}
}
for(i=0;i<3;i++)
{
printf("array is:%d",a[i])
}
getch();
return;
}
| Is This Answer Correct ? | 3 Yes | 5 No |
Post New Answer View All Answers
What is quick sort in c?
Why is C language being considered a middle level language?
What is spark map function?
Between macros and functions,which is better to use and why?
What is a memory leak? How to avoid it?
What does *p++ do? What does it point to?
Explain 'bus error'?
Explain what are binary trees?
write a program to generate address labels using structures?
In c language can we compile a program without main() function?
When I set a float variable to, say, 3.1, why is printf printing it as 3.0999999?
What are register variables in c?
Do you know the purpose of 'register' keyword?
When is the “void” keyword used in a function?
Explain what is the best way to comment out a section of code that contains comments?