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 Posted / 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 View All Answers
What unique experience or qualifications separate you from other candidates?
hi i am doing cause study about Enterprising young IT Entrepreneur who has recently started a small business running web hosting services for SME (Small to Medium Enterprise). You frequently need to meet (potential) clients to sell your services to them. You do so with presentations and demonstrations of your products. You will also want to install certain development software for your software development projects. So what software to use? need a server? what types of hosting should i use?
How we do trimming in Solaris and how to prevent the /var from become disk full.
Describe your ideal job and/or boss.
Can you help me what kind of PM interview questions company can ask based on below job description?: *Work with business development, editorial, marketing and other departments as needed to understand and prioritize project requests. *Work with online creative, IT, and development departments to gather and disseminate project requirements. *Maintain weekly web projects production calendar *Assist in the quality assurance process associated with code releases to development, staging and production servers. *Participate in planning meetings for new site initiatives. Document, clarify and articulate requirements and bring thoughts to the discussion. *Distribute reports summarizing project milestones and associated tasks. *Create rough wireframes and functional diagrams for developers using Microsoft Visio. *Work with third party vendors to procure services associated with web development. *Work with our partners to ensure deliverables and associated tasks stay on track. Can you help me what kind of PM question company can ask based on above job description?
what is the difference between BI and pervasive BI?
What id the meaning of MIS ? MIS nasure, charactersitcs, purpose ? how can the leanr about them ?
what is variable?
cost accounting is a tool for dicission making expline
What are your strengths and talents?
what do you mean by "Closures with help of Top Management and Colleagues"
What change management processes have you used to ensure that change is introduced properly?
Is any one has SAP GTS( Global Trade Services)Reading and Exercise material. If so, please e-mail me.
Why general ledger accounts require "post automatically" setting in SAP??
How retrive the deleted file frm UAT by doing migration in SAP BO 4.0