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 |
Describe your ideal job and/or boss.
state the role of cost accounting in large scale industry
i am going for the IT Officer written test,can any body mail me the question bank to Pragyanmund@rediffmail.com
What change management processes have you used to ensure that change is introduced properly?
0 Answers Hindustan Unilever Limited,
in my office to access data fast i replaced 8 port hub with 8 port dlink switch my network connectivity is gone all the led keep blinking do you i have to change cabeling or change the switch
In SAP Business Objects XI R3.1,4.0 Central Configuration Manager is down means what we have to do?
What are your strengths and talents?
How do you manage suppliers?
1 Answers ABC, Pick n Pay, Safeway,
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,
i have completed my bca from annamalai university in distance mode. Now am working as a Front Office Executive in a Software co. I am interested in HR field. and i want to do MBA HR from symbiosis university through Distance mode..Am i thinking right for myself??? please suggest me.!
What unique experience or qualifications separate you from other candidates?
Does S5700-24TP-SI-AC support dual power?