Answer Posted / anon
#include <stdio.h>
int main() {
int i, j, size, values[100], temp;
printf("Enter the size of an array: ");
scanf("%d",&size);
printf("Enter the values of array: ");
for(i=0;i<size;i++){
scanf("%d",&values[i]);
}
for(i=0;i<size-1;i++){
for(j=i+1;j<size;j++){
if(values[i]<values[j]){
temp=values[i];
values[i]=values[j];
values[j]=temp;
}
}
}
printf("Sorted array:
");
for(i=0;i<size;i++){
printf("%d ",values[i]);
}
return 0;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
What's a good way to check for "close enough" floating-point equality?
Explain what is a 'locale'?
What is define c?
How is = symbol different from == symbol in c programming?
What is your stream meaning?
Do you know what are the properties of union in c?
What are control structures? What are the different types?
What does %p mean c?
the constant value in the case label is followed by a a) semicolon b) colon c) braces d) none of the above
What was noalias and what ever happened to it?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
What is the scope of static variable in c?