void print_stars();* void option_list();void divisors(int n);int summation(int s);int factorial (int n);int main(void) (int number, result, op;char flag:11printf("Enter an integer number >...


1include<stdio.h><br>void print_stars();<br>* void option_list();<br>void divisors(int n);<br>int summation(int s);<br>int factorial (int n);<br>int main(void) (<br>int number, result, op;<br>char flag:<br>11<br>printf(
"); scanf( "%d" , &number ); dol option_list(); scanf("%d", &op); 10 11 switch(op) ( 1A case 1: divisors(number): break; 19 case 2: result = summation(number); printf("Summation - %d\n" , result); YY break; YO case 3: result = factorial(number) printf("Factorial - %d\n" , result); break; default: printf("\NERROR: %d is unrecognized option!!! \n", op); ; TY TA print_stars(); printf("Do you want to check another function? (Y/N)> "); scanf(" %c" , &flag): ) while (flag == "Y || flag == 'y); ro return 0; t. void option_list(){ print_stars(): printf("1: Find the divisors \n"): printf("2: Compute the summuation\n"); printf("3: Compute the factorial n"); print_stars(); printf("Please enter your choice: "); EA void print_stars(){ int i; for(i- 1;i< 25="" ;="" i++)="" printf("");="" or="" printf("\n");="" 00="" 01="" void="" divisors(int="" n)="" {="" ov="" int="" i;="" printf("divisors="" of="" %d="" are\n",n):="" for(i="1;icen;i++)" if(n%i="=0)" printf("="" %d",);="" 1.="" printf("\n");="" 10="" int="" factorial="" (int="" n)="" 11="" int="" i,="" fact="1;" for="" (i-2;ice="" n;="" i++)="" fact="" *="i;" return="" fact;="" 1a="" 19="" y="" int="" summation(int="" s)="" vy="" if="" (s="=" 0)="" vr="" return="" o;="" ye="" else="" yo="" return="" s+="" summation(s-1);="" "/="">
Extracted text: 1include void print_stars(); * void option_list(); void divisors(int n); int summation(int s); int factorial (int n); int main(void) ( int number, result, op; char flag: 11 printf("Enter an integer number > "); scanf( "%d" , &number ); dol option_list(); scanf("%d", &op); 10 11 switch(op) ( 1A case 1: divisors(number): break; 19 case 2: result = summation(number); printf("Summation - %d\n" , result); YY break; YO case 3: result = factorial(number) printf("Factorial - %d\n" , result); break; default: printf("\NERROR: %d is unrecognized option!!! \n", op); ; TY TA print_stars(); printf("Do you want to check another function? (Y/N)> "); scanf(" %c" , &flag): ) while (flag == "Y || flag == 'y); ro return 0; t. void option_list(){ print_stars(): printf("1: Find the divisors \n"): printf("2: Compute the summuation\n"); printf("3: Compute the factorial n"); print_stars(); printf("Please enter your choice: "); EA void print_stars(){ int i; for(i- 1;i< 25="" ;="" i++)="" printf("");="" or="" printf("\n");="" 00="" 01="" void="" divisors(int="" n)="" {="" ov="" int="" i;="" printf("divisors="" of="" %d="" are\n",n):="" for(i="1;icen;i++)" if(n%i="=0)" printf("="" %d",);="" 1.="" printf("\n");="" 10="" int="" factorial="" (int="" n)="" 11="" int="" i,="" fact="1;" for="" (i-2;ice="" n;="" i++)="" fact="" *="i;" return="" fact;="" 1a="" 19="" y="" int="" summation(int="" s)="" vy="" if="" (s="=" 0)="" vr="" return="" o;="" ye="" else="" yo="" return="" s+="">
Question #2:<br>Study the following C program and answer the below questions<br>Hint: you might run it in Dev C++ before starting answering the questions!<br>a) Show a sample output of the program.<br>b) Extract a function declaration (prototype) for:<br>1) void functions with void argument<br>2) void function with a single input argument<br>3) function with a single input argument and return<br>4) a recursive function<br>c) What is the difference between normal functions and recursive functions?<br>d) How many times are the function print_stars() called in the program? (mention the line number of each<br>call).<br>

Extracted text: Question #2: Study the following C program and answer the below questions Hint: you might run it in Dev C++ before starting answering the questions! a) Show a sample output of the program. b) Extract a function declaration (prototype) for: 1) void functions with void argument 2) void function with a single input argument 3) function with a single input argument and return 4) a recursive function c) What is the difference between normal functions and recursive functions? d) How many times are the function print_stars() called in the program? (mention the line number of each call).
Jun 10, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here