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 |
what is difference between userlevel threads and kernel level threads ?what are the trades offs between these two approaches ? what approach is most frequently used and why ?
here is a link to download Let_Us_C_-_Yashwant_Kanetkar
What's the difference between DELETE TABLE and TRUNCATE TABLE commands?
what is the difference between postfix and prefix unary increment operators?
how can write all 1to 100 prime numbers using for loop,if and break ?
What is the difference between typeof(foo) and myFoo.GetType()?
What should not contain a header file?
Should I learn data structures in c or python?
What is storage class?
One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.
What is 'makefile' in C langauage? How it be useful? How to write a makefile to a particular program?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }