Write a PL/SQL program to print the sequence 103, 99, 96...3.

AnswerBot
2y

PL/SQL program to print numbers in descending order from 103 to 3

  • Use a loop to iterate from 103 to 3

  • Print each number in the loop

  • Decrement the loop counter by 3 in each iteration

shanmukha kimidi
2mo
DECLARE P_INPUT01 NUMBER := &NUMBER01 ; P_INPUT02 NUMBER := &NUMBER02 ; v_store number ; begin for i in reverse P_INPUT02..P_INPUT01 loop v_store := mod( i , 3 ) ; if v_store = 0 then dbms_output.put_...read more
Harshad Bangar
5mo
declare v_num number :=103 begin while v_num >=3 loop dbms_output.put_line(v_num); v_num := v_num-4; end loop; end;
Himanshu
1y

ls=[103]

for i in range(4,103,3):

ls.append(str(ls[0]-i))

print(ls)

above is in python
Balaji Bomade
2y

set serveroutput on;

declare

i number :=103;

i_target number :=100;

begin

DBMS_OUTPUT.put_line(i);

while(i>3) loop

if(i>i_target) then

i:=i-4;

else

i:=i-3;

end if;

DBMS_OUTPUT.put_line(i);

end loop;

end;

Deepak Kumar Muduli
2y

Begin

For i reverse 1..103

Loop

If mod(i,3)=0 then

Dbms_output.put_line( i);

End if;

End loop;

End;

Prakash A
2y

set serveroutput on ;

declare

x number;

begin

for i in reverse 1..102 loop

if mod(i,3)=0 then

dbms_output.put_line(i);

end if;

end loop;

end;

Garima Jhade
2y

Declare

i number;

Begin

for i in reverse 1..103

loop

dbms_output.put_line(i);

end loop;

end;

Sathish Kumar Kannayiram
2y

Declare

i number;

Begin

for i in reverse 1..103

loop

if mod(i,3)=0 then

dbms_output.put_line(i);

end if;

end loop;

end;

Select
Add answer anonymously...

TCS Plsql Developer interview questions & answers

A Plsql Developer was asked 4mo agoQ. What is the difference between procedures and functions?
A Plsql Developer was asked 4mo agoQ. What is the difference between char, varchar, and varchar2 data types?
A Plsql Developer was asked 4mo agoQ. What are the differences between Rank and Dense Rank in SQL?

Popular interview questions of Plsql Developer

A Plsql Developer was asked 4mo agoQ1. What is the difference between procedures and functions?
A Plsql Developer was asked 4mo agoQ2. What is the difference between char, varchar, and varchar2 data types?
A Plsql Developer was asked 4mo agoQ3. What are the differences between Rank and Dense Rank in SQL?
TCS Plsql Developer Interview Questions
Stay ahead in your career. Get AmbitionBox app
play-icon
play-icon
qr-code
Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+

Reviews

10L+

Interviews

4 Cr+

Salaries

1.5 Cr+

Users

Contribute to help millions

Made with ❤️ in India. Trademarks belong to their respective owners. All rights reserved © 2025 Info Edge (India) Ltd.

Follow Us
  • Youtube
  • Instagram
  • LinkedIn
  • Facebook
  • Twitter
Profile Image
Hello, Guest
AmbitionBox Employee Choice Awards 2025
Winners announced!
awards-icon
Contribute to help millions!
Write a review
Write a review
Share interview
Share interview
Contribute salary
Contribute salary
Add office photos
Add office photos
Add office benefits
Add office benefits