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

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

0 Answers   Wipro,


From where I should start to prepare for cat?

0 Answers  


The process of discovering relationships using data analytics tools, such as statistical software, statistical graphing, and mapping software is referred to as pattern mapping.

0 Answers  


What is the difference between product based and service based IT companies?

2 Answers   Wipro, ABC,


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   Symbiosis, EWR, MAH, SCDL Symbiosis Center for Distance Learning,






sir iam going for an interview on feb 2nd week and i would like too ask questions that they will pose too me 1:i hav choosen conchordia wisconsin why these university what should b my answer 2:i had selected mis in mba from conchordioa university why these course if they question wat should b my answer 3:and last question is wat is guarantee u will come bck my dad works as a production manager in saudi arabia soo wat should b my anser too them because i am going for mba wat should b my answer for return gurantee pls reply too me it will b gr8 off u yours sicerly

0 Answers  


Write a C Program to create a structured data file named Student.dat to store the roll no, name and course. Provide following functions: 1. Accept the values from the user using structure variables. Store the contents in a file. 2. Display the file. 3. The user should be able to add new records to the existing file. And display the new file.

4 Answers   IBM, ABC, CSC, Symbiosis, CMS, Student, Chowgule, Practical Viva Questions, University Exams,


Describe some of your most important career accomplishments

0 Answers   Visa,


DataStage 7.5 & DataStage 8.5 :Which Oracle Database version is supported as target datasource?

0 Answers  


what do u mean by altkey?

0 Answers  


why u choose mba after bca?

2 Answers   Samsung,


state the role of cost accounting in large scale industry

0 Answers  






Categories
  • Business Administration Interview Questions Business Administration (515)
  • 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 (110)
  • Infrastructure Management Interview Questions Infrastructure Management (14)
  • IT Management Interview Questions IT Management (97)
  • Supply Chain Management Interview Questions Supply Chain Management (15)
  • 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)