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 switch in c?
How to develop software using "c" programming?
main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*
What is difference between scanf and gets?
What is main () in c language?
What is a function in c?
du u know test pattern for robosoft? Plz share
1 Answers RoboSoft, TATA, Wipro,
write a c program to accept a given integer value and print its value in words
4 Answers Vernalis, Vernalis Systems,
Write the Program to reverse a string using pointers.
CAN WE DEFINE ANY FUNCTION WITHIN A FUNCTION.
Explain how can you determine the size of an allocated portion of memory?
where does it flourished?