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
What is extern variable in c with example?
What are linked lists in c?
Describe the difference between = and == symbols in c programming?
I just typed in this program, and it is acting strangely. Can you see anything wrong with it?
What are structure members?
what is bit rate & baud rate? plz give wave forms
What is cohesion in c?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
How important is structure in life?
Explain what is a 'locale'?
How can you invoke another program from within a C program?
a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if
What is the difference between āgā and āgā in C?
What is c language used for?
What is wrong with this program statement?