answersLogoWhite

0


Best Answer

Identification division.

Program-id. Prime.

Environment division.

Data division.

Working-storage section.

77 n pic 9(3).

77 q pic 9(3).

77 r pic 9(3).

77 i pic 9(3) value 1.

Procedure division.

Para-a.

Display ( 1 , 1 ) erase.

Display ( 2 , 1 ) "enter an integer:".

Accept ( 2 , 20 ) n.

If n = 1

display ( 3 , 1 ) "number is not prime"

go to stop-para.

Para-b.

Add 1 to i.

If i = n

display ( 3 , 1 ) "number is prime"

go to stop-para.

Divide n into i giving q remainder r.

If r = 0

display ( 3 , 1 ) "number is not prime"

go to stop-para.

Go to para-b.

Stop-para.

Stop run.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a cobol program to find prime number or not?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the largest prime no that is stored in 8 bit pattern?

Write your own prime number program and find out.


How can I write a program to display prime numbers from 1 to 100?

Write a function that implements an algorithm that checks to see if a particular integer is prime (returning a boolean). Write a program that uses that function on each number from 1 to 100, and if true, displays that number.


Program for print prime all number from 1 to 100 in foxpro?

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.


Write a java program to display the number is prime or not?

Simply use a for loop (i) that runs from 2 to N-1. Checking if N % i 0 then its a prime number.


Write a c program to find given number is prime or not?

Yes, do write, or if you're too lazy to your homework, use google.


How do you write a number as a product of its prime factors?

write the number 14as a product of prime factor?


Is 3185 a prime number?

Write 3185 as a prime number


How do you write a c program to get a range from user and give a list of prime numbers?

To get all tutorials of "c programming" Reference:cprogramming-bd.com/c_page2.aspx# prime number


With a given big integer number which is the product of two prime numbers how do you find them?

First write a program to generate the prime number. After one prime number was generated, divide the big int number by the prime number. If the remainder is zero then quotient is the second prime number ( also it is important to check whether the quotient is prime number or not because sometimes you will get wrong answer). Repeat the process until you get the result.


How do write 525 as a product of prime factors?

write the prime factorization of the number. simple as that.


How do you write out the prime factorization of a prime number?

The prime number is the prime factorization. For example, the prime factorization of the prime number 3 is 3. Get it?


How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?