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 character constants?
How can you determine the maximum value that a numeric variable can hold?
In a byte, what is the maximum decimal number that you can accommodate?
Who invented b language?
What is difference between union and structure in c?
program to convert a integer to string in c language'
What is double pointer?
Write a function that will take in a phone number and output all possible alphabetical combinations
List some applications of c programming language?
What is the scope of an external variable in c?
What is variable and explain rules to declare variable in c?
What are the 5 types of inheritance in c ++?
When would you use a pointer to a function?
What is operator promotion?
What is a sequential access file?