Question
Part 4 Correct errors in program . ( 1 0 points in total): 1) ( 5 points) The following program is used to display numbers
Part
4
Correct
errors in program
.
(
1
0
points in total):
1)
(
5
points)
The following program is used to
display numbers between two intervals
.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include stdio.h
#define true 1
#define false 0
void prime(int low, int high){
int i =0, flag=0;
printf("Prime numbers between %d and %d are: ", low, high);
while (low < high)
{
flag = false;
for(i = 0
; i <= low/2; ++i)
{
if(low % i == 0)
{
flag = true;
break;
}
}
if (flag ==
true
)
f("%d ", low);
++low;
}
printf("
\
n");
}
int main()
{
int low, high;
printf("Enter two numbers(intervals): ");
scanf("%d %d", low,
high);
prime.
prime(low,high);
return 0;
}
Which line
(s)
is
(are)
incorrect?
And how to correct it
(them)
? Please write down your
correction
for that
line (those lines)
Step 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