Find the highest of three numbers and print them using ascending orders?
#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 |
how does the C compiler interpret the following two statements p=p+x; q=q+y; a.p=p+x; q=q+y b.p=p+xq=q+y c.p=p+xq; q=q+y d.p=p+x/q=q+y
What is the significance of an algorithm to C programming?
WHOT IS CHAR?
ASCII stands for
How to reverse a linked list
1 Answers Aricent, Fidelity, IBM, TCS,
What is the use of extern in c?
1,1,5,17,61,217,?,?.
I want tcs placement papers of 2004-2009 , its urgent
1.)how to find d most repeated word in a string? string ="how do you do"?? output should be do
1 Answers AAS, Nagarro, Vuram,
Explain the concept and use of type void.
Is r written in c?
What is difference between union All statement and Union?