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 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
What is the Lvalue and Rvalue?
what are the static variables
8 Answers HCL, iFlex, TCS, Wipro,
Explain 'bit masking'?
What is structure in c language?
main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }
what is the function of .h in #include<stdio.h> in c ?
23 Answers HCL, IBM, Wipro,
What are the standard predefined macros?
how we can say java is platform independent, while we require JVM for that particular Operating System?
What is meant by high-order and low-order bytes?