Programming in C Create your own designs using the shapes provided in the function definitions Source Code provided: #in

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Programming in C Create your own designs using the shapes provided in the function definitions Source Code provided: #in

Post by answerhappygod »

Programming in C
Create your own designs using the shapes provided in thefunction definitions
Source Code provided:
#include <stdio.h>
//Step 1: function prototypes
//the prototypes needed for the stick figure program(game)
void circle(void);
void triangle(void);
void horiz_line(void);
void parallel();
int main()
{
//step 3: function calls
//Through different variations of function calls you can createother figures
circle();
horiz_line();
triangle();
horiz_line();
parallel();
printf("\n\n\n");
triangle();
horiz_line();
parallel();
horiz_line();
return 0;
}
//step 2: function definition
void circle(void)
{
printf(" * * \n");
printf(" * *\n");
printf(" * *\n");
}
void triangle(void)
{
printf(" /\\ \n");
printf(" / \\ \n");
printf(" / \\ \n");
printf("/ \\ \n");
}
void horiz_line(void)
{
printf("---------\n");
}
void parallel()
{
printf("| |\n");
printf("| |\n");
printf("| |\n");
printf("| |\n");
}
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply