Question
COMPUTER PROGRAMMING. FUNCTIONS in C (specifically Data Abstraction). -I am using a Dev-C++ software compiler. Problem: This is my function code: void parksideTria(int size, int
COMPUTER PROGRAMMING.
FUNCTIONS in C (specifically Data Abstraction).
-I am using a Dev-C++ software compiler.
Problem:
This is my function code: void parksideTria(int size, int seed) { int triangle[size][size]; int i, j, count = seed;
if (size 10 || seed 9) { printf("Invalid input. Please enter a size between 1 and 10 and a seed between 1 and 9. "); return; }
for (i = 0; i 9) { count = 1; } } } }
for (i = 0; i
And this is the call in main function: printf(" SIZE N= "); scanf("%d", &size); printf(" SEED S= "); scanf("%d", &seed); parksideTria(size, seed); This is the output of that code: 1 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 The output of my code is wrong. Please edit my code or make a new one that could generate the correct output shown on the Problem.
Thank you so much in advance!
void parksideTria(int size,int seed) \{ I* PARKSIDE'S TRIANGLE PARKSIDE'S TRIANGLE is generated from two numbers -- the size and the seed. The size determines how many rows are in the triangle, and the seed determines the first number in the triangle. For example, here are two PARKSIDE TRIANGLES: SIZE N=6, SEED S=1 SIZE N=5, SEED S=3 Analyze the above examples, discover the rule, and write a program that will generate PARKSIDE'S TRIANGLE given any size N (1-10 only) and any seed S (1-9 only). Test your program by generating PARKSIDE'S TRIANGLE for N=6,S=1 and N=7,S=9. define this function to display the parkside's triangle given the size and seed as input parametersStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started