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 |
shorting algorithmS
to convert a string without using decrement operater and string functions
What is a null string in c?
Write a program that his output 1 12 123
x=2,y=6,z=6 x=y==z; printf(%d",x)
13 Answers Bharat, Cisco, HCL, TCS,
What are examples of structures?
What is a node in c?
Why c language?
What is the difference between int main and void main in c?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What is the stack in c?
Was 2000 a leap year?