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
Do string constants represent numerical values?
What language is c written?
Are there constructors in c?
Explain how do you use a pointer to a function?
Explain bitwise shift operators?
Can i use “int” data type to store the value 32768? Why?
How do I create a directory? How do I remove a directory (and its contents)?
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
How can I trap or ignore keyboard interrupts like control-c?
What is the use of the function in c?
write a proram to reverse the string using switch case?
What are pragmas and what are they good for?
What does s c mean in text?
What is the difference between the expression “++a” and “a++”?
What does the c preprocessor do?