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

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?

Posted Date: 2/23/2013 6:08:31 AM | Location : United States







Related Discussions:- Fortran function for find and print out all prime number, Assignment Help, Ask Question on Fortran function for find and print out all prime number, Get Answer, Expert's Help, Fortran function for find and print out all prime number Discussions

Write discussion on Fortran function for find and print out all prime number
Your posts are moderated
Related Questions
Expertsmind brings you unique solution in java assignments Packages A Java packages is a process for planning Java sessions into namespaces just like the segments of Modu

do you solve questions of assigments?

Implement the Prim's algorithm with array data structure as described in slide 12 of the file 04mst.ppt. Your program should have a runtime complexity of O(n2) and should be as eff

non restoring division

1. CMP and SUB CMP is used for comparing 2 registers by subtraction them from one another, but answer is not saved, whereas SUB subtracts 2 registers and saves the answer.

Calculate the total price to purchase all the components required to build a state-of-the-art gaming computer from components available on the internet. Before attempting this exer

This section is proposed to be a catch all for several of the fundamental concepts which are used occasionally in working with systems of differential equations. There will not be

Please explain about sub programming.

( Airline Reservations System ) A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You are to w

What are Relative URLS ? When a web browser reads an HTML document, it has a great deal of information about the document. This includes the protocol used to retrieve the docu