declare n number; i number; flag number; begin i:=2; flag:=1; n:=7; for i in 2..n/2 loop if mod(n,i)=0 then flag:=0; exit; end if; end loop; if flag=1 then dbms_output.put_line('prime'); else dbms_output.put_line('not prime'); end if; end; / Output is attached below:
declare
n number;
i number;
flag number;
begin
i:=2;
flag:=1;
n:=7;
for i in 2..n/2
loop
if mod(n,i)=0
then
flag:=0;
exit;
end if;
end loop;
if flag=1
then
dbms_output.put_line(‘prime’);
else
dbms_output.put_line(‘not prime’);
end if;
end;
/
Draw the queue structure in each case when the following operations are performed on an empty queue. (a) Add A, B, C, D, E, F (b) Delete two letters (c) Add G (d) Add H (e) Delete four letters (f) Add I
DOWNLOAD ATTACHMENT FOR ANSWER:
DOWNLOAD ATTACHMENT FOR ANSWER:
See lessReverse the order of elements on stack S a. using two additional stacks b. using one additional queue c. using one additional stack and some additional non-array variables
DOWNLOAD ATTACHMENT:
DOWNLOAD ATTACHMENT:
See lessQ.Write a program in PL/SQL to insert records from one table to another.
DOWNLOAD ATTACHMENT:
DOWNLOAD ATTACHMENT:
See lessWrite a program in PL/SQL to print the value of a variable inside and outside a loop using LOOPEXIT statement.
Download the attachment for answer.
Download the attachment for answer.
See lessWrite a program in PL/SQL to check whether a number is prime or not using goto statement with for loop.
DOWNLOAD ATTACHMENT FOR ANSWER
DOWNLOAD ATTACHMENT FOR ANSWER
See lessWrite a program in PL/SQL to check whether a number is prime or not using goto statement with for loop.
declare n number; i number; flag number; begin i:=2; flag:=1; n:=7; for i in 2..n/2 loop if mod(n,i)=0 then flag:=0; exit; end if; end loop; if flag=1 then dbms_output.put_line('prime'); else dbms_output.put_line('not prime'); end if; end; / Output is attached below:
declare
n number;
i number;
flag number;
begin
i:=2;
flag:=1;
n:=7;
for i in 2..n/2
loop
if mod(n,i)=0
then
flag:=0;
exit;
end if;
end loop;
if flag=1
then
dbms_output.put_line(‘prime’);
else
dbms_output.put_line(‘not prime’);
end if;
end;
/
Output is attached below:
See less