Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!