write the program for prime numbers?

Answer Posted / naveen reddy

This is written in PL/SQL: TO check wether given number is prime or not

DECLARE
i number:=&i;
j number:=2;
ch number:=0;
BEGIN
WHILE(j<=i/2) loop

if mod(i,j)=0 then
dbms_output.put_line('not prime');
ch:=1;
exit ;
else
j:=j+1;
end if;
end loop;

if ch=0 then
dbms_output.put_line('prime number');
end if;
end;

Is This Answer Correct ?    106 Yes 23 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List out few of the applications that make use of Multilinked Structures?

1716


What is string function c?

773


What is identifier in c?

753


What is s or c?

787


hi send me sample aptitude papers of cts?

1860


List some of the static data structures in C?

956


Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?

869


in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none

818


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

806


write a program using linked list in which each node consists of following information. Name[30] Branch Rollno Telephone no i) Write the program to add information of students in linked list

2515


Tell me the use of bit field in c language?

823


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2402


What is the difference between single charater constant and string constant?

846


What is use of pointer?

773


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

914