Write a C Program to declare an array for 2 0 floats.
Accept the values from the user
sort the two arrays in descending order. Merge the two
arrays into a new array and display
the new array.
Answer / irfan fazli (trying to help tw
/* Build your program around this..... */
main()
{
int a, b, c;
float t;
/*declare an array for 2 0 floats*/
float aList1[20];
float aList2[20];
float aList[40];
/* Accept the values from the user */
/* 1 */
for (c=0; c++;c <20)
scanf("%f", alist1+c);
/* 2 */
for (c=0; c++;c <20)
scanf("%f", alist2+c);
/* sort the two arrays in descending order */
/* 1 */
for (a=0; a++; a <20)
for (b=a+1; b++; b <20)
if (aList1[a] < aList1[b])
{
t = aList1[a] ;
aList1[a] aList1[b] ;
aList1[b] =t ;
}
/* 2 */
for (a=0; a++; a <20)
for (b=a+1; b++; b <20)
if (aList2[a] < aList2[b])
{
t = aList2[a] ;
aList2[a] aList2[b] ;
aList2[b] =t ;
}
/* Merge the two arrays into a new array */
c=0;
while (a < 20 || b < 20)
if (aList1[a] > aList2[b])
aList[c++] = aList[a++]
else
aList[c++] = aList[b++]
/* display the new array */
for (c=0; c++;c <40)
printf("%f, ", alist1[c]);
printf("\n");
}
| Is This Answer Correct ? | 14 Yes | 9 No |
cost accounting is a tool for dicission making expline
I'm working with a crosstab in cognos now. Page 1 contains crosstab Page 2 contains list Fact - Revenue Dimension - Product line, Year If I click on the revenue (cell value) it should goto the particular record in another list which is located in a separate page. However, the fact could not be bookmarked. I don't know why. Do you have suggestions? Thanks in advance.
where do you see yourself after 5 or 10 years
4 Answers Hotel Jobs, Vodafone,
What is computer-based information system (CBIS) mean?
Pls tell me how to answer dis question... Red is My FAV color? White is MY FAV Color? & Black is my FAV color
why prototype is used?
The process of discovering relationships using data analytics tools, such as statistical software, statistical graphing, and mapping software is referred to as pattern mapping.
What are your strengths and talents?
could you provide me the information regarding UNIVESAL WORK LIST(UWL)?this question is regarding SAP EP.
Write a C Program to declare an array for 2 0 floats. Accept the values from the user sort the two arrays in descending order. Merge the two arrays into a new array and display the new array.
1 Answers EWR, MAH, SCDL Symbiosis Center for Distance Learning, Symbiosis,
YOU ARE COMING FROM CITY "A" AND WANT TO REACH "B". 3 ROADS MEET AT JUNCTION 'X',TO/FROM A,B,AND C. AT X,2 PERSON ARE STANDING-1ALWAYS SAY TRUTH ,ANOTHER ALWAYS SAY LIE. IN ONLY ONE QUESTION,HOW WILL YOU ASK THE WAY TO 'B'(YOU ARE COMING FROM 'A')
List the employee numbers and salary of all current employees who earn more than the employee number 16. In each row show both the employee's salary and the salary of employee 16.
Business Administration (517)
Marketing Sales (1279)
Banking Finance (3209)
Human Resources (747)
Personnel Management (68)
Hotel Management (29)
Industrial Management (113)
Infrastructure Management (14)
IT Management (97)
Supply Chain Management (16)
Operations Management (39)
Funding (79)
Insurance (494)
Waste Management (1)
Labor Management (48)
Non Technical (73)
Business Management AllOther (546)