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
Is it possible to have a function as a parameter in another function?
if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0
What does volatile do?
Explain the properties of union.
Is main is a keyword in c?
What is the difference between malloc calloc and realloc in c?
can we change the default calling convention in c if yes than how.........?
diff between exptected result and requirement?
Where can I get an ansi-compatible lint?
what is uses of .net
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
code for quick sort?
What is NULL pointer?
Explain b+ tree?