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.



Write a C Program to declare an array for 2 0 floats. Accept the values from the user sort the tw..

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

Post New Answer

More IT Management Interview Questions

Describe your ideal job and/or boss.

0 Answers  


state the role of cost accounting in large scale industry

0 Answers  


i am going for the IT Officer written test,can any body mail me the question bank to Pragyanmund@rediffmail.com

0 Answers  


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

2 Answers  






In SAP Business Objects XI R3.1,4.0 Central Configuration Manager is down means what we have to do?

0 Answers   Wipro,


What are your strengths and talents?

0 Answers  


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.!

0 Answers   IBM,


What unique experience or qualifications separate you from other candidates?

0 Answers  


Does S5700-24TP-SI-AC support dual power?

2 Answers  


Categories
  • Business Administration Interview Questions Business Administration (517)
  • Marketing Sales Interview Questions Marketing Sales (1279)
  • Banking Finance Interview Questions Banking Finance (3208)
  • Human Resources Interview Questions Human Resources (745)
  • Personnel Management Interview Questions Personnel Management (68)
  • Hotel Management Interview Questions Hotel Management (29)
  • Industrial Management Interview Questions Industrial Management (113)
  • Infrastructure Management Interview Questions Infrastructure Management (14)
  • IT Management Interview Questions IT Management (97)
  • Supply Chain Management Interview Questions Supply Chain Management (16)
  • Operations Management Interview Questions Operations Management (39)
  • Funding Interview Questions Funding (79)
  • Insurance Interview Questions Insurance (494)
  • Waste Management Interview Questions Waste Management (1)
  • Labor Management Interview Questions Labor Management (48)
  • Non Technical Interview Questions Non Technical (73)
  • Business Management AllOther Interview Questions Business Management AllOther (546)