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
How do you list files in a directory?
What is the difference between array and pointer?
Differentiate between the = symbol and == symbol?
What are the parts of c program?
what is the difference between class and unio?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is a c token and types of c tokens?
Is array name a pointer?
Can we use any name in place of argv and argc as command line arguments?
What is && in c programming?
What standard functions are available to manipulate strings?
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
Explain built-in function?
Is c# a good language?
An application package has been provided to you without any documents for the following application. The application needs to be tested. How will you proceed?