Find the highest of three numbers and print them using ascending orders?
Answer Posted / venugopal
#include<stdio.h>
main()
{
int a[3],i,f,s;
clrscr();
printf("enter 3 no's");
for( i=0;i<3;i++)
{
scanf("%d",&a[i]);
}
/* sorting starts here*/
for (f=0;f<3;f++)
{
for(s=f+1;s<3;s++)
{
if(a[s]<a[f])
{
temp=a[s];
a[s]=a[f];
a[f]=temp;
}
}
}
/* now sorted array is*/
for(int x=0;x<3;x++)
{
printf("%d",a[x]);
}
/* biggest elt is*/
printf("%d",a[2]);
getch();
}
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Write a code to achieve inter processor communication (mutual exclusion implementation pseudo code)?
Explain zero based addressing.
hi any body pls give me company name interview conduct "c" language only
What does volatile do?
Why does everyone say not to use gets?
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
Why are all header files not declared in every c program?
What does 4d mean in c?
How can I change their mode to binary?
How can you tell whether a program was compiled using c versus c++?
Can we declare variable anywhere in c?
What is a example of a variable?
What is a class c rental property?
What is methods in c?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same