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 the purpose of sprintf() function?
regarding pointers concept
What is an lvalue in c?
What are the types of data files?
Explain the properties of union.
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
What is the purpose of main( ) in c language?
‘SAVEPOINT’ and ‘ROLLBACK’ is used in oracle database to secure the data comment. Give suitable examples of each with sql command.
When should I declare a function?
Do you know pointer in c?
Why is c so important?
what is the difference between 123 and 0123 in c?
cavium networks written test pattern ..
Write a code of a general series where the next element is the sum of last k terms.
Explain how do you determine the length of a string value that was stored in a variable?