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


Please Help Members By Posting Answers For Below Questions

What is %g in c?

620


What are reserved words with a programming language?

604


Which built-in library function can be used to match a patter from the string?

747


stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.

1856


Why is c called a mid-level programming language?

729






State two uses of pointers in C?

642


Explain the difference between null pointer and void pointer.

673


Does sprintf put null character?

604


What is the general form of a C program?

600


Which header file is used for clrscr?

582


Why void is used in c?

566


What is an endless loop?

804


Explain how do you determine a file’s attributes?

594


What is realloc in c?

581


find out largest elemant of diagonalmatrix

1651