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 %g in c?
What are reserved words with a programming language?
Which built-in library function can be used to match a patter from the string?
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.
Why is c called a mid-level programming language?
State two uses of pointers in C?
Explain the difference between null pointer and void pointer.
Does sprintf put null character?
What is the general form of a C program?
Which header file is used for clrscr?
Why void is used in c?
What is an endless loop?
Explain how do you determine a file’s attributes?
What is realloc in c?
find out largest elemant of diagonalmatrix