Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use the C language for this code. Thanks so much in advance! (Try to comment as much as possible). Program #2: Drawing Triangles Write

Please use the C language for this code. Thanks so much in advance! (Try to comment as much as possible).

image text in transcribedimage text in transcribed

Program #2: Drawing Triangles Write a program that asks the user to enter an integer between 1 and 15. If the number entered is outside that range, your program should print out an error message and re-prompt for another number. (This is an input validation loop.) Note that the basic input statement in C is scanf (). See Unit 1 Slide 83+ for a description of that function Once the user enters a number in the correct range, your program will print out four patterns of asterisks that look like the following. Note that the number provided by the user is equal to the height of the pattern Let's say the input value was 8. Then the output should be: k * CS1325 -Introduction to Programming page: 4 For the final pattern, ask the user for an odd number between 1 and 15. (Your program should use an input validation loop to restrict valid input from the user to odd numbers between 1 and 15.) If that number is 7, then the diagram appears as follows: Note that, in contrast to the previous diagrams, there are spaces between adjacent asterisks on the first and last lines ASCII Table: Binary Oct Dec Hex Glyph Bisay Oct Dec Hex Glygh Binary 0ct Dec Hex Glyph 00000403220| s. 10000001006440| @ 110000014096 001 041 33 21 0010 042 34 22 0011033623| # 1000011103 674) cl 1100011140 9963 c 01000443624| $ 10001001046844 DI 110010014410064 d 0101045 37 251 % 1000101 10545 E | 1100101145101 66 . 011004630261 & 1000110 t06roF 110011014610266 f 111 047 39 27 1000 050 40 100 1000 110 72 48 H 110 1000 150 104 68 001 051 41 29 010 062 42 2A100 1010 112 74 J110 1010 152 106 101,063 43 20 1001011313 75 K | 110101115310768 k 100 05444 20 101 055 45 20 110 056 46 2 11067 47 2F 100000110166 41 A | 1100001141197 61 100001010266 110001014298 621 b 1000111 107 71 47 110 0111 147 103 6 100100",11. 73 401 | 1101001151105 09 100110011476 4C L | 1101100154 1036e 1 00 1101 115 77 40M110 1101 155 109 6Dm 100 1110116 70 | N | 1101110196 110 GE n ' 40 30| 0 101000012080 501 P | 1110000160 112 70 p 1 0001 061 49 31 1 101 0001 121 81 51 111 0001 161 113 71 0010 062 50 322101 0010 122 82 52R111 0010 162 114 72 0011 063 51 333101 0011 123 83 53S111 0011 163 115 73 0100 064 52 34 4101 0100 124 84 54 T 111 0100 164 116 74 1010108853 35 1010101 t258655| U | 111010110511775 u 1011006654 36 6 101 01101250656| V| 1110110166 1107G 1011106756 37 7 101011102787 w 1110111119.77 w 110000705630|8 101 1000 130 50|X| 1111000 170 12078 x 1 100 1037,57 39| 9 101100,131 59 Y | 1111001171| 12, 79 1101007250 11011 073 3 101 1010 132 90 5A111 1010 172 122 7A 01 1011 133 91 58 11 1011 173 123 78 1101 075 61 30101 1101 135 93 50

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

Database Fundamentals Study Guide

Authors: Dr. Sergio Pisano

1st Edition

B09K1WW84J, 979-8985115307

More Books

Students also viewed these Databases questions

Question

List the four steps in the model for giving praise.

Answered: 1 week ago

Question

List the criteria for setting objectives.

Answered: 1 week ago

Question

Describe four content motivation theories.

Answered: 1 week ago