C programming using functions

[ad_1]

TWIN PRIMES IN A RANGE OF NUMBERS
———————————–

Twin primes are two consequetive odd numbers that are prime.

Write a function that returns 1 if the input is a prime and
0 otherwise.

int is_prime(int number) {
}

Write a C Program to generate all twin primes in a given range
of numbers using the is_prime function.

Your program will input following from the command line:

min : start of range, an integer

max : end of range, an integer

These numbers define the range of numbers [min,max]
inclusively.

Here is a sample input line:

1 7

We will output every twin prime in the range
[1, 7].

Here is the output of the above input line:

3 5
5 7

Sample Runs:
———–

Input:
1 7

Output:
3 5
5 7

Input:
2 9

Output:
3 5
5 7

Input:
7 21

Output:
11 13
17 19

Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code “Newclient”

The post C programming using functions appeared first on Savvy Essay Writers.


C programming using functions was first posted on July 4, 2020 at 3:34 pm.
©2020 “Savvy Essay Writers”. Use of this feed is for personal non-commercial use only. If you are not reading this article in your feed reader, then the site is guilty of copyright infringement. Please contact me at savvyessaywriters@gmail.com

[ad_2]

Source link