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
How do I get an accurate error status return from system on ms-dos?
What is the best way to store flag values in a program?
What is masking?
What are multidimensional arrays?
Which is best book for data structures in c?
Why is sprintf unsafe?
Is c dynamically typed?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What are different storage class specifiers in c?
What should malloc(0) do?
.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; }
Explain the difference between structs and unions in c?
What is getch c?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
Difference between pass by reference and pass by value?