Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please save the program with the name 'triangle.c' Write a nested for loop that prints the following output: 1. 1 2 1 1 2 4

image text in transcribed
image text in transcribed
Please save the program with the name 'triangle.c' Write a nested for loop that prints the following output: 1. 1 2 1 1 2 4 2 1 1 2 4 8 4 2 1 1 2 4 8 16 8 4 2 1 1 2 4 8 16 32 16 8 4 2 1 1 2 4 8 16 32 64 32 16 8 4 2 1 1 2 48 16 32 64 128 64 32 16 842 1 Hint: Here is the psudocode solution: for row from 0 to 7{ pad leading blanks in a row like this for the column from 1 to 7-row: print a set of spaces print left half of row for column from 0 to row: print spaces followed by 2 raised to the power of the column print right half of row for column from row-1 to 0: print spaces followed by 2 raised to the power of the column print a new line 2. Please save the program with the name 'grade.c' Write a program that will prompt the user to input ten student scores to an array, The score value is between 0 100. The program will display the smallest and greatest of those values. It also displays the average score. Example: please input student scores one at a time. Student 1 : -10 Try again! Student 1 : 10 Student 2 : 110 Try again! Student 2: 20 Student 3 : 30 Student 4 : 40 Student 5 : 50 Student 6 : 60 Student 7 : 70 Student 8 : 80 Student 9 : 90 Student 10 : 100 *final result ***** The maximum score is 100 The minimum score is 10 The averange score is 55

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions