In C Language please..   Let's make a simple program that mirrors this beautiful idea where we ask the user for two integer inputs. The first one would represent the starting number and the second one would represent the next n integers after it. For example, if the first number inputted is 2 and the second number inputted is 3, then the output would be 3, 4, 5 because these are the next 3 integers after 2.   Instructions: In the code editor, you are provided with a main() function that asks the user for two integers and calls the slowDisplay() function. This slowDisplay() function is a recursive function which should perform the functionality explained in the problem description above. This function is only partially implemented as it lacks a base case. Your task is to add the base case needed by this recursive function. Input 1. Starting integer 2. Number of integers Output Enter starting integer: 2 Enter how many next integers: 3 3 4 5

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question
100%

In C Language please..

 

Let's make a simple program that mirrors this beautiful idea where we ask the user for two integer inputs. The first one would represent the starting number and the second one would represent the next n integers after it.

For example, if the first number inputted is 2 and the second number inputted is 3, then the output would be 3, 4, 5 because these are the next 3 integers after 2.

 

Instructions:

  1. In the code editor, you are provided with a main() function that asks the user for two integers and calls the slowDisplay() function.
  2. This slowDisplay() function is a recursive function which should perform the functionality explained in the problem description above.
  3. This function is only partially implemented as it lacks a base case. Your task is to add the base case needed by this recursive function.

Input

1. Starting integer

2. Number of integers

Output

Enter starting integer: 2
Enter how many next integers: 3
3
4
5
main.c
1. Slowly But Surely
1 #include<stdio.h>
2
by CodeChum Admin
void slowDisplay (int, int);
In life, good things take time.
4
5- int nain(void) {
int start, nextCount;
Let's make a simple program that mirrors this beautiful idea
7
where we ask the user for two integer inputs. The first one would
printf("Enter starting integer: ");
scanf("%d", &start);
represent the starting number and the second one would
represent the next n integers after it.
9
10
printf("Enter how nany next integers: ");
scanf("%d", &nextCount);
11
12
For example, if the first number inputted is 2 and the second
13
number inputted is 3, then the output would be 3, 4, 5 because
14
slowDisplay(start + 1, nextCount);
these are the next 3 integers after 2.
15
16
return 0;
17 }
Instructions:
18
1. In the code editor, you are provided with a main() function
19 - void slowDisplay(int start, int nextCount) I
20
// TODO: Add the base case here
if) {
printf("%d ", start);
slow Display (start + 1, nextCount - 1);
that asks the user for two integers and calls the
21"
slowDisplay() function.
22
23
2. This slowDisplay() function is a recursive function which
24
should perform the functionality explained in the problem
25
description above.
3. This function is only partially implemented as it lacks a
base case. Your task is to add the base case needed by
this recursive function.
Input
1. Starting integer
2. Number of integers
Output
Enter starting integer: 2
Enter how many next integers: 3
3-4-5
Transcribed Image Text:main.c 1. Slowly But Surely 1 #include<stdio.h> 2 by CodeChum Admin void slowDisplay (int, int); In life, good things take time. 4 5- int nain(void) { int start, nextCount; Let's make a simple program that mirrors this beautiful idea 7 where we ask the user for two integer inputs. The first one would printf("Enter starting integer: "); scanf("%d", &start); represent the starting number and the second one would represent the next n integers after it. 9 10 printf("Enter how nany next integers: "); scanf("%d", &nextCount); 11 12 For example, if the first number inputted is 2 and the second 13 number inputted is 3, then the output would be 3, 4, 5 because 14 slowDisplay(start + 1, nextCount); these are the next 3 integers after 2. 15 16 return 0; 17 } Instructions: 18 1. In the code editor, you are provided with a main() function 19 - void slowDisplay(int start, int nextCount) I 20 // TODO: Add the base case here if) { printf("%d ", start); slow Display (start + 1, nextCount - 1); that asks the user for two integers and calls the 21" slowDisplay() function. 22 23 2. This slowDisplay() function is a recursive function which 24 should perform the functionality explained in the problem 25 description above. 3. This function is only partially implemented as it lacks a base case. Your task is to add the base case needed by this recursive function. Input 1. Starting integer 2. Number of integers Output Enter starting integer: 2 Enter how many next integers: 3 3-4-5
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Operators
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education