Fortran function for find and print out all prime number, Programming Languages

Assignment Help:

Write a Fortran LOGICAL FUNCTION, called "is_prime", which determines if a given integer value is a prime number or not (A prime number is a natural number which has only two distinct natural number divisors: 1 and itself, such as 23,31). Note that 1 is not a prime number.

Write a main program that reads an integer number, n, from keyboard and writes (using format descriptor "I") all prime numbers between 1 and n to the screen as well as to an output file named "primes.dat", using is_prime function. This program must also determine the total number of prime numbers between 1 and n. Test/run your program and answer the following questions:

a- Find and print out all prime numbers between 1 and 200 (include print out in your report).

b- How many prime numbers exist between 100 and 10000?


Related Discussions:- Fortran function for find and print out all prime number

Write a complete program using floating-point operations, Question 1: a...

Question 1: a) Assume that B is an array of 50 words; write a code which will place the smallest integer of array B in register AX. b) Write a small code (only three instr

Discuss the php operators, Question 1 Explain the history of Internet ...

Question 1 Explain the history of Internet Question 2 What are the advantages of DHTML? Question 3 Explain the concept of DOM Question 4 How does AJAX work

What is dynamic binding, Dynamic Binding: - Binding refers to the linking ...

Dynamic Binding: - Binding refers to the linking of a procedure call to the code to be executed in response to the call. Dynamic binding (late binding) means that the code associa

Real-time driver model , AMCC PowerPC 440 EPx Sequoia Evaluation Kit, Embed...

AMCC PowerPC 440 EPx Sequoia Evaluation Kit, Embedded Linux Development Kit (ELDK), and Xenomai A. Description of the Project The project's objective is to design a set of

Implement a two-dimensional table in prolog, Implement a two-dimensional ta...

Implement a two-dimensional table in Prolog. Your program will contain: 1.  An insert_entry predicate that takes a table, row, column and an entry and inserts the entry at the g

Write a perl script that prints the contents of a file, Write a Perl script...

Write a Perl script that prints the contents of a file Write a Perl script that prints the contents of a file, prefixing each line with a line number. The script should acc

Pseudo code for random numbers, Pseudo code the shows logic for a program ...

Pseudo code the shows logic for a program that generates a random number, then ask the user to think of a number between 1 and 10

Visual Basic 2010 Karate Payments MDI Application, The following are requir...

The following are required for this lesson: Complete the Project "Adding New Payments," which is the Karate Payments that includes the Adding New Payments, Deleting Payments,

Write a program that draws the initials j, Write a program that draws the i...

Write a program that draws the initials J G P on the form similar to that shown in Fig J 1 (using straight lines and curve semicircles). The figure can not have corners. All ends a

Shell script print “gm/afternoon/evening”acc to system time, Normal 0 ...

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd