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
Can a local variable be volatile in c?
Tell me when would you use a pointer to a function?
How variables are declared in c?
Whats s or c mean?
Is multithreading possible in c?
What is the benefit of using #define to declare a constant?
Explain how do you print an address?
can we change the default calling convention in c if yes than how.........?
What is the condition that is applied with ?: Operator?
How can you pass an array to a function by value?
Explain what is a pragma?
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
Explain what is the benefit of using #define to declare a constant?
How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same
When a c file is executed there are many files that are automatically opened what are they files?