Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the Asterisk and other characters on your keyboard, write a unique and original C program that outputs a simple shape or image. For example,

Using the Asterisk and other characters on your keyboard, write a unique and original C program that outputs a simple shape or image.

For example, you could output a Circle or X or other object based on a few println calls.

Include your code and a screen capture of you running the code.

EX ONLY:

The program I wrote creates a diamond pattern using '*'s

#include  int main() { int i, j, n, spaces; char ch = '*'; n = 5; spaces = n-1; for(i = 1; i <= n; i++) { for(j = 1; j <= spaces; j++) { printf(" "); } spaces--; for(j = 1; j <= 2 * i - 1; j++) { printf("%c", ch); } printf(" "); } spaces = 1; for(i = 1; i <= n; i++) { for(j = 1; j <= spaces; j++) { printf(" "); } spaces++; for(j = 1; j <= 2 * (n - i)- 1; j++) { printf("%c", ch); } printf(" "); } return 0; } 

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_2

Step: 3

blur-text-image_3

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

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions

Question

=+ differentiate between a number of different leader styles

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago