Programming in C
Programming in C
4th Edition
ISBN: 9780321776419
Author: Stephen G. Kochan
Publisher: Addison-Wesley
bartleby

Concept explainers

Question
Book Icon
Chapter 7, Problem 13E
Program Plan Intro

Program Plan:

  • Include required header files
  • Definition for the function “sort()”.
    • Declare the variables.
    • Condition to check the “i<n-1”.
      • Condition to check the “j<n”.
        • Check whether to sort in increasing order.
          • Assign “a[i] ” to “temp”.
          • Assign “a[j] ” to “a[i]”.
          • Assign “a[j]” to “temp”.
        • Check whether to sort in decreasing order.
          • Assign “a[i]” to “temp”.
          • Assign “a[j] ” to “a[i]”.
          • Assign “a[j]” to “temp”
  • Define the main function
    • Declare the required variable
    • Initialize the array.
    • Print the statement.
    • Loop to traverse the array.
      • Print the element.
    • Call the function “sort()”.
    • Loop to traverse the array.
      • Print the element.
      • Print new line
      • Return the value “0”.

Blurred answer
Students have asked these similar questions
The Philippine Stock Exchange (PSE) is the national stock market of the Philippines. As of 1 January 2022, there are 278 listed companies in PSE. Write a C++ program that asks user input stock symbol, checks whether the input symbol is included in the listed companies in the Philippine Stock Exchange market, and outputs the position of the listed company in the array. Use linear search algorithm. Note: Use this list of stock symbols attached in the table. S.No. Symbol 1 2GO 2 HOUSE 3 BRN 4 ANS 5 ABA 6 AEV 7 AP 8 AR 9 ABS 10 ABSP 11 ACEN 12 ACEX 13 ACE 14 ANI 15 ALLDY 16 HOME 17 AGI 18 FOOD 19 ACR 20 APVI 21 ALHI 22 APO 23 APC 24 APX 25 APL 26 ARA 27 AREIT 28 ALCO 29 AAA 30 AUB 31 ABG 32 ATI 33 AT 34 ATN 35 AB 36 AXLM 37 AC 38 ALI 39 ALLHC 40 BPI 41 BSC 42 BLFI 43 BDO 44 BEL 45 BC 46 BCOR 47 BH 48 BLOOM 49 BMM 50 BHI 51 BKR 52 CEB 53 CHI 54 CLI 55 CHP 56 CAT 57 CEU 58…
Please do only A and B In this program, you should define an array of 10 elements in your data segment with these values:? = {11, 12,−10, 13, 9, 12, 14, 15,−20, 0}a. Write a function which finds the maximum value of this array.b. Write another function which calculates the summation of this array.c. Call these functions in your main program, and print the outputs of these functions to theuseri. “The maximum is 15”ii. “The summation is 56”d. What is the address that has been used by the simulator for this array?
Using “Def” keyword write a function that returns the Max element of the given array elements (The function name will be MaxofArrayElements) Not: Write some print functions to see the outputs inside each function. (Python programming language)  (Solution must be like first image but max of arrays.it shouldnt be like second image)
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education