Question

5. (20 points) Write a C function to fill a 2D array with a multiplication table(1-5) and a function to print it out. Print each integer inside the multiplication table using "%5d" format specifier and make necessary adjustments to print in the format shown below. Example Output: 1 2 3 4 5 6 7 8 9 10 --- 1 1 2 3 4 5 6 7 8 9 10 2 2 4 6 8 10 12 14 16 18 20 3 3 6 9 12 15 18 21 24 27 30 4 4 8 12 16 20 24 28 32 36 40 5 5 10 15 20 25 30 35 40 45 50

          5. (20 points) Write a C function to fill a 2D array with a multiplication table(1-5)
and a function to print it out. Print each integer inside the multiplication table
using "%5d" format specifier and make necessary adjustments to print in the
format shown below.
Example Output:
1	2	3	4	5	6	7	8	9	10
---
1	1	2	3	4	5	6	7	8	9	10
2	2	4	6	8	10	12	14	16	18	20
3	3	6	9	12	15	18	21	24	27	30
4	4	8	12	16	20	24	28	32	36	40
5	5	10	15	20	25	30	35	40	45	50
        
Show more…
5. (20 points) Write a C function to fill a 2D array with a multiplication table(1-5)
and a function to print it out. Print each integer inside the multiplication table
using "%5d" format specifier and make necessary adjustments to print in the
format shown below.
Example Output:
1	2	3	4	5	6	7	8	9	10
—
1	1	2	3	4	5	6	7	8	9	10
2	2	4	6	8	10	12	14	16	18	20
3	3	6	9	12	15	18	21	24	27	30
4	4	8	12	16	20	24	28	32	36	40
5	5	10	15	20	25	30	35	40	45	50

Added by Rosa M.

Close

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
5. (20 points) Write a C function to fill a 2D array with a multiplication table (1-5) and a function to print it out. Print each integer inside the multiplication table using "%5d" format specifier and make necessary adjustments to print in the format shown below. Example Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
Close icon
Play audio
Feedback
Powered by NumerAI
David Collins Ivan Kochetkov
Jennifer Stoner verified

Willis James and 78 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
write-any-c-program-that-declares-an-array-alpha-of-50-components-of-type-double-initialize-the-array-so-that-the-first-25-components-are-equal-to-the-square-of-the-index-variable-the-positi-09615

Write a C++ program that declares an array alpha of 50 components of type double. Initialize the array so that the first 25 components are equal to the square of the index variable (the position that element will occupy), and the last 25 components are equal to three times the index variable. Output the array so that 10 elements per line are printed. For the number at index 5, the value would be 25, which is 5 squared. The 25th index would hold a value of 75, which is 3 times 25. Tasks: - Program outputs the alpha array - Did not hard code program output - Declared and initialized the alpha array to a size of 50 elements.

Willis J.

c-assignment-3a-rectangle-write-an-application-that-allows-a-user-to-input-the-height-and-width-of-a-rectangle-it-should-output-the-area-and-perimeter-of-the-rectangle-use-methods-for-enteri-87026

C# assignment 3A: Rectangle Write an application that allows a user to input the height and width of a rectangle. It should output the area and perimeter of the rectangle. Use methods for entering the values, performing the computations, and displaying the results. Results should be formatted with one position to the right of the decimal and printed number aligned in a tabular display.

Akash M.

write-a-script-that-will-print-the-following-multiplication-table-do-not-type-individual-elements-explicitly-1-2-4-3-6-9-5-10-15-20-25-6-12-18-24-30-36-46529

Write a script that will print the following multiplication table: (Do not type individual elements explicitly) 1 2 4 3 6 9 5 10 15 20 25 6 12 18 24 30 36

Samriddhi S.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,783 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,838 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,437 solutions

*

Transcript

-
00:01 Hello, welcome to this lesson.
00:01 In this lesson, we write a c+ + program that would declare an ari, alpha, that has 50 components.
00:11 Then we would initialize it so that the first 25 components are equal to the square of the index variable, and also the second 25 components are equal to three times.
00:28 The three times the in this okay nothing will print okay so let's step the first thing that we do is to declare alpha so we have double alpha which should be given 50 components this plot here we use a fall loop to do the initialization we have four for int i is equals to zero.
01:22 All right, that is less than 50.
01:25 So start from zero and it ends at 49.
01:29 That is 50 times.
01:31 I plus plus.
01:34 Here, this is who would do.
01:43 Who would say fis less than 24.
01:54 If i is less than 25.
01:59 That means from zero to 24.
02:01 For as half of the array okay so we just have this is what we do a square so a square of all the all the indices so we have alpha thing in alpha at i which is equal to i times itself so we are making sure that for each for each from zero for me there's zero to twenty four we have the index times itself as the value that's occupying that position.
02:53 Now if the index is greater than 24, that is from 25 to 50 to 49, we want to multiply it by 3.
03:07 So, this one would say alpha, i mean, it's equals 3 times.
03:16 So having the item times itself, we are multiplying it by, according to the question.
03:29 Then after we are done, we need to print it.
03:32 So we use the following.
03:35 So 4.
03:37 J that is called to 0.
03:43 J that is less than j plus plus...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever