Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Find the highest of three numbers and print them using ascending orders?



Find the highest of three numbers and print them using ascending orders?..

Answer / 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

More C Interview Questions

what is the advantage of function pointer

16 Answers   CMC, CS, Freshdesk, L&T, LG Soft, Matrix, TCS,


x=2,y=6,z=6 x=y==z; printf(%d",x)

13 Answers   Bharat, Cisco, HCL, TCS,


Consider the following C program. #include <stdio.h> int main() { int i; for (i=0;i<3;++i) { fork();fork(); } } How many processes are created when running this program (including the initial one)? Explain

2 Answers  


What is the Lvalue and Rvalue?

2 Answers  


what are the static variables

8 Answers   HCL, iFlex, TCS, Wipro,


Explain 'bit masking'?

0 Answers   EXL,


What is structure in c language?

0 Answers  


main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }

3 Answers  


what is the function of .h in #include<stdio.h> in c ?

23 Answers   HCL, IBM, Wipro,


What are the standard predefined macros?

0 Answers  


how we can say java is platform independent, while we require JVM for that particular Operating System?

3 Answers   Honeywell, TCS,


What is meant by high-order and low-order bytes?

0 Answers  


Categories