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
Question: (a) How do you implement the following in ASP.NET: (i) Server-side Comments (ii) Server-side Include Directives. (b) What is the purpose of a HashTable? (

I need help with some simple matlab statements


.NET class libraries in .NET Whether you create value in C# or VB.NET, you are getting in touch with techniques in the same .NET category your local library. The same .NET str

Define Call by value - Computer Programming? Functions are raise by writing their name and an appropriate list of arguments within parenthesis. Usually these arguments are in t

Type of Linear Programming - DEA The Express Dry Cleaners currently has four locations in the Chicago area and willing be opening the fifth in the very near future.  Mr. James,

#question. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Description: *

what is the difference between class and interface

Write a function called threshold1 (in a file called 'threshold1.m'. The function takes three arguments. The first two are arbitrarily sized arrays, A and B, and the third is a pos