Find the highest of three numbers and print them using ascending orders?
Answer Posted / venugopal
#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 |
Post New Answer View All Answers
When can you use a pointer with a function?
What is difference between function overloading and operator overloading?
which of the following is allowed in a "C" arithematic instruction a) [] b) {} c) () d) none of the above
What is a pointer in c plus plus?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
write a program fibonacci series and palindrome program in c
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
Can you explain what keyboard debouncing is, and where and why we us it? please give some examples
What is the difference between far and near ?
Explain what is a program flowchart and explain how does it help in writing a program?
Define and explain about ! Operator?
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
What is null pointer in c?
please send me the code for multiplying sparse matrix using c
Is it fine to write void main () or main () in c?