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 sizeof know array size?
Explain what are linked list?
Why c language?
What is structure padding & expalain wid example what is bit wise structure?
What are structure members?
while initialization of array why we use a[][2] why not a[2][]...?
What should not contain a header file?
When should the const modifier be used?
Write a small C program to determine whether a machine's type is little-endian or big-endian.
Write a code to generate a series where the next element is the sum of last k terms.
main() { float a=3.2e40; printf("%d",a); }
which one is better structure or union?(other than the space occupied )