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 are the types of c language?
Where are local variables stored in c?
In a switch statement, what will happen if a break statement is omitted?
How can variables be characterized?
What is a structural principle?
my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?
What is an array? What the different types of arrays in c?
Explain how can you tell whether two strings are the same?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
Where are some collections of useful code fragments and examples?
Explain the difference between null pointer and void pointer.
How do you declare a variable that will hold string values?
Explain what is a 'locale'?
Do character constants represent numerical values?
How do you print an address?