Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Write a function in C language that will take a 2D Array of size 3x3 from the user.
Your Program should:
1. Prompt the user to enter 2D array of size 3x3.
2. Calculate the sum of all rows.
3. Calculate the sum of all columns
4. Return 1 if the sum of all rows is greater than sum of all columns, 0 otherwise.
Your main program should print the result based on the returned values.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
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
- using chapters 1 to 7 from the book c how to program 8 editionarrow_forwardDo the following lab by one dimensional array(not vector) Write a C++ program that: part a) for 3 students find the average of a student by asking him how many grades do you have. To answer to this question, determine the size of the array(number of grades) and then ask the user to enter grades(the number of the grades is equal to the size of the array) then calculate the average for each student. Hence, you will calculate 3 averages. to calculate the average, use the array accumulator. Also when you get each grade validate it. validation for grade means that you check whether a grade is between 0 and 100. if the grade is negative or a grade is more than 100 then it is not valid and you have to ask the user to enter a grade again. Part b) Find the maximum and minimum grades for each student. Part c) Print the sorted list of the grades for each student. example: if grades user entered are: 60 78 98 23 45 then sorted list is:23 45 60 78 98arrow_forwardThe code should be in C and not hard-coded. It should use 2D arrays.arrow_forward
- write a c++ program: Create an array with 11 integers, which will be randomly selected from the range of 0 to 100. Print the items of the array on screen as one line. Develop a function that takes the array as argument and perform these operations: -Find the minimum of array items and replace (swap) with first item of the array. -Find the maximum of array items and replace (swap) with last item of the array. -Find the average of array’s items and assign it to middle location of the array. The average of numbers should be calculated as an integer. (hint: static_cast<int>(float))arrow_forwardWrite a program in which the main function reads an integer array data_items of size 10 and an integer variable num. It then passes the array data_items and the num variable to a function called count_divisors which counts the number of elements of array data_items that are divisible by num and returns the count to the main program which prints it. Sample Output: Enter 10 integer for the array: 12 14 16 32 8 33 1 21 44 64 Enter a number to test as a divisor of array elements:8 There are 4 elements divisible by 8arrow_forwardPlease write the following in very simple C++ code: Write a function that calculates the average of an array, where the smallest element in the array is dropped. If there are multiple copies of the smallest value, just ignore one copy. You can assume the array has at least two items in it. The function header is as follows. int getAverage (int a[], int size)arrow_forward
- Please complete this program in C++ Please enusre that there is plenty of comments. PLENTY even if unessessary. Please include screenshots of actual code, screenshots of output, and code in the browser so I can copy and paste. Thank you.arrow_forwardI can both pass and return an array value from a function. Group of answer choices: True False this is for c++arrow_forwardIn C++ i need the fill in the functions that will complete this code for the program to work.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education