Hi, I missed a couple classes due to being sick this past week and I am having trouble getting steered in the right direction for my programming assignment. I'd ask the professor for help but he has a total of four hours during the week for office hours, all of which I have a class. But anyways...
Write a C program that produces prime pairs. At the start, user is prompted to input a positive integer less than 100,000 after which the program prints all the prime pairs in the range 3 through <= N (user input). The program should check the user input to be a value greater than 5 and less than 100,000.
So an example of the running program would look something like the following...
{{
Enter an integer > 5 and < 100,000 and the program will print all the prime pairs up to that value: -4
The integer must be > 5 and < 100,000: 120000
The integer must be > 5 and < 100000: 400
List of prime pairs from 3 to 400
3 - 5
5- 7
11- 13
17- 19
. .
. .
. .
. .
347- 349
}}
Now I know that I need to use a ceiling function and I want to do something like...
i<=(ceil(sqrt(d ouble)n)); i++)
but, I really don't know where to start, or end for that matter with this program.
I could use some help, thanks.
Write a C program that produces prime pairs. At the start, user is prompted to input a positive integer less than 100,000 after which the program prints all the prime pairs in the range 3 through <= N (user input). The program should check the user input to be a value greater than 5 and less than 100,000.
So an example of the running program would look something like the following...
{{
Enter an integer > 5 and < 100,000 and the program will print all the prime pairs up to that value: -4
The integer must be > 5 and < 100,000: 120000
The integer must be > 5 and < 100000: 400
List of prime pairs from 3 to 400
3 - 5
5- 7
11- 13
17- 19
. .
. .
. .
. .
347- 349
}}
Now I know that I need to use a ceiling function and I want to do something like...
i<=(ceil(sqrt(d ouble)n)); i++)
but, I really don't know where to start, or end for that matter with this program.
I could use some help, thanks.
Comment