Answered By : 
puneet Replied Date : Nov 16 2010 
Answer : 
there is no need to have loop in here
u can prompt one number from user
declare
a number:='&a';
begin
for mod(a,2)=0
then
dbms_output.put_line('even number');
else
dbms_output.put_line('odd number');
end if;
end;

Answered By : 
hanmath pradeep Replied Date : May 30 2012 
Answer : 
hi frnds...............here with loop ort without loop it doesn't matter .......... if we give input=4 then the desired out put will be even number......but i have a doubt....
if input=123456
then the output should be as follows...
the odd number is 1
the even number is 2
the odd number is 3
the even number is 4
the odd number is 5
................... if any one knows related plsql program then plzz ..... forward it to my id ie., thanmathpradeep@gmail.com

Answered By : 
sravan Replied Date : May 31 2012 
Answer : 
declare
a number:=&a
begin
if(mod(a,2))=0
then
dbms_output.put_line('even');
else
dbms_output.put_line('odd');
end if;
end;

Answered By : 
mga kidoy all of u.. Replied Date : Jul 20 2012 
Answer : 
mga kidoy all of u..

Answered By : 
karen catapat Replied Date : Dec 4 2012 
Answer : 
malay

Answered By : 
sneha Replied Date : Jan 31 2013 
Answer : 
create or replace procedure even(a in number)as
begin
if mod(i,2)=0
then
dbms_output.put.line('even='even);
else
dbms_output.put.line('odd='odd);
else
end if;
end;

Answered By : 
null Replied Date : Feb 1 2014 
Answer : 

Answered By : 
null Replied Date : Jan 20 2014 
Answer : 

Answered By : 
null Replied Date : Dec 30 2013 
Answer : 

Answered By : 
null Replied Date : Dec 29 2013 
Answer : 

Answered By : 
null Replied Date : Dec 26 2013 
Answer : 

Answered By : 
null Replied Date : Dec 24 2013 
Answer : 

Answered By : 
null Replied Date : Dec 23 2013 
Answer : 

Answered By : 
Arjun Replied Date : Apr 4 2013 
Answer : 
How to solve the same question with out using any conditions.

Answered By : 
null Replied Date : Dec 6 2013 
Answer : 

Answered By : 
Priyabrat Rath Replied Date : Dec 6 2013 
Answer : 
declare
a number;
m number;
n number;
begin
m:=2;
n:=50;
for a is in m..n step2
dbms_output.put_line(a);
end loop;
end;

Answered By : 
null Replied Date : Nov 29 2013 
Answer : 

Answered By : 
null Replied Date : Nov 23 2013 
Answer : 

Answered By : 
null Replied Date : Nov 7 2013 
Answer : 

Answered By : 
null Replied Date : Nov 2 2013 
Answer : 

Answered By : 
null Replied Date : Nov 1 2013 
Answer : 

Answered By : 
null Replied Date : Nov 1 2013 
Answer : 

Answered By : 
null Replied Date : Oct 15 2013 
Answer : 

Answered By : 
null Replied Date : Oct 13 2013 
Answer : 

Answered By : 
null Replied Date : Oct 9 2013 
Answer : 

Answered By : 
saira Replied Date : Sep 30 2013 
Answer : 
1.how to create a function to check whether a number is odd or even?
2.raise an exception if salary is in negative?
3.raise an exception if row count is zero?

Answered By : 
null Replied Date : Feb 6 2014 
Answer : 

Answered By : 
null Replied Date : Feb 24 2014 
Answer : 

Answered By : 
null Replied Date : Mar 9 2014 
Answer : 

Answered By : 
null Replied Date : Mar 11 2014 
Answer : 

Answered By : 
null Replied Date : Apr 10 2014 
Answer : 

Answered By : 
null Replied Date : Apr 15 2014 
Answer : 

Answered By : 
null Replied Date : Apr 16 2014 
Answer : 

Answered By : 
null Replied Date : Apr 21 2014 
Answer : 

Answered By : 
null Replied Date : May 6 2014 
Answer : 

Answered By : 
null Replied Date : May 7 2014 
Answer : 

Answered By : 
null Replied Date : Jun 6 2014 
Answer : 

Answered By : 
null Replied Date : Jun 10 2014 
Answer : 

Answered By : 
null Replied Date : Jun 27 2014 
Answer : 

Answered By : 
null Replied Date : Jul 6 2014 
Answer : 

Answered By : 
null Replied Date : Jul 9 2014 
Answer : 

Answered By : 
null Replied Date : Jul 10 2014 
Answer : 

Answered By : 
null Replied Date : Jul 16 2014 
Answer : 

Answered By : 
null Replied Date : Jul 17 2014 
Answer : 

Answered By : 
null Replied Date : Jul 21 2014 
Answer : 

Answered By : 
null Replied Date : Jul 26 2014 
Answer : 

Answered By : 
null Replied Date : Aug 1 2014 
Answer : 

Answered By : 
null Replied Date : Aug 2 2014 
Answer : 

Answered By : 
null Replied Date : Aug 3 2014 
Answer : 

Answered By : 
null Replied Date : Aug 4 2014 
Answer : 

Answered By : 
null Replied Date : Aug 4 2014 
Answer : 

Answered By : 
null Replied Date : Aug 6 2014 
Answer : 

Answered By : 
null Replied Date : Aug 7 2014 
Answer : 

Answered By : 
null Replied Date : Aug 10 2014 
Answer : 

Answered By : 
null Replied Date : Aug 15 2014 
Answer : 

Answered By : 
null Replied Date : Aug 17 2014 
Answer : 

Answered By : 
null Replied Date : Aug 21 2014 
Answer : 

Answered By : 
null Replied Date : Aug 27 2014 
Answer : 

Answered By : 
null Replied Date : Aug 29 2014 
Answer : 

Answered By : 
null Replied Date : Aug 29 2014 
Answer : 

Answered By : 
null Replied Date : Sep 17 2014 
Answer : 

Answered By : 
null Replied Date : Sep 28 2014 
Answer : 

Answered By : 
null Replied Date : Sep 28 2014 
Answer : 

Answered By : 
null Replied Date : Oct 6 2014 
Answer : 

Answered By : 
null Replied Date : Oct 11 2014 
Answer : 

Answered By : 
null Replied Date : Oct 12 2014 
Answer : 

Answered By : 
null Replied Date : Oct 14 2014 
Answer : 

Answered By : 
null Replied Date : Nov 2 2014 
Answer : 

Answered By : 
null Replied Date : Nov 4 2014 
Answer : 

Answered By : 
null Replied Date : Nov 4 2014 
Answer : 

Answered By : 
null Replied Date : Nov 12 2014 
Answer : 

Answered By : 
null Replied Date : Dec 26 2014 
Answer : 

Answered By : 
samir raj khadka Replied Date : Jan 3 2015 
Answer : 
decleare
i number;
begin
for i in 1.......10 loop
if mod(i,2)=0
then
Dbms_output.put_line(i'is odd number');
else
Dbms_output.put_line(i'is even number');
endif;
endloop;
end;

Answered By : 
samir raj khadka Replied Date : Jan 3 2015 
Answer : 
decleare
i number;
begin
for i in 1.......10 loop
if mod(i,2)=0
then
Dbms_output.put_line(i'is odd number');
else
Dbms_output.put_line(i'is even number');
endif;
endloop;
end;

Answered By : 
null Replied Date : Jan 16 2015 
Answer : 

Answered By : 
null Replied Date : Feb 24 2015 
Answer : 

Answered By : 
shankar Replied Date : Mar 12 2015 
Answer : 
evlo padichalumm puryavae maatukaee...ennathan vaalkayooo..

Answered By : 
null Replied Date : May 3 2015 
Answer : 

Answered By : 
Abhisek Replied Date : May 7 2015 
Answer : 
 Using pl/sql function
SET SERVEROUTPUT ON
CREATE OR REPLACE FUNCTION EV(A NUMBER)
RETURN VARCHAR2
IS
BEGIN
IF MOD(A,2)=0 then
RETURN 'EVEN';
ELSE
RETURN 'ODD';
END IF;
END;
EXECUTE
select EV(11) FROM DUAL;
OUTPUT
ODD

Answered By : 
null Replied Date : May 11 2015 
Answer : 

Answered By : 
null Replied Date : May 11 2015 
Answer : 

Answered By : 
null Replied Date : Jun 11 2015 
Answer : 

Answered By : 
null Replied Date : Jun 11 2015 
Answer : 

Answered By : 
pandu Replied Date : Jun 14 2015 
Answer : 
Hi Abhisek
In place of EV i am giving F1 then it is showing error.
can you help me please.

Answered By : 
null Replied Date : Jun 19 2015 
Answer : 

Answered By : 
null Replied Date : Jul 12 2015 
Answer : 

Answered By : 
null Replied Date : Jul 12 2015 
Answer : 

Answered By : 
null Replied Date : Jul 14 2015 
Answer : 

Answered By : 
null Replied Date : Aug 13 2015 
Answer : 

Answered By : 
null Replied Date : Aug 13 2015 
Answer : 

Answered By : 
null Replied Date : Aug 23 2015 
Answer : 

Answered By : 
null Replied Date : Aug 23 2015 
Answer : 

Answered By : 
null Replied Date : Sep 10 2015 
Answer : 

Answered By : 
null Replied Date : Sep 10 2015 
Answer : 

Answered By : 
null Replied Date : Sep 10 2015 
Answer : 

Answered By : 
null Replied Date : Sep 12 2015 
Answer : 

Answered By : 
sagan Replied Date : Sep 22 2015 
Answer : 
plz expalin briefly

Answered By : 
null Replied Date : Sep 25 2015 
Answer : 

Answered By : 
null Replied Date : Sep 25 2015 
Answer : 

Answered By : 
null Replied Date : Oct 13 2015 
Answer : 

Answered By : 
null Replied Date : Oct 13 2015 
Answer : 

Answered By : 
null Replied Date : Oct 15 2015 
Answer : 

Answered By : 
null Replied Date : Oct 15 2015 
Answer : 

Answered By : 
null Replied Date : Nov 6 2015 
Answer : 

Answered By : 
null Replied Date : Nov 6 2015 
Answer : 

Answered By : 
null Replied Date : Nov 6 2015 
Answer : 

Answered By : 
null Replied Date : Nov 6 2015 
Answer : 

Answered By : 
null Replied Date : Nov 12 2015 
Answer : 

Answered By : 
null Replied Date : Nov 12 2015 
Answer : 

Answered By : 
null Replied Date : Nov 12 2015 
Answer : 

Answered By : 
null Replied Date : Nov 12 2015 
Answer : 

Answered By : 
null Replied Date : Dec 8 2015 
Answer : 

Answered By : 
null Replied Date : Dec 9 2015 
Answer : 

Answered By : 
null Replied Date : Dec 10 2015 
Answer : 

Answered By : 
null Replied Date : Jan 6 2016 
Answer : 

Answered By : 
null Replied Date : Jan 29 2016 
Answer : 

Answered By : 
null Replied Date : Feb 1 2016 
Answer : 

Answered By : 
null Replied Date : Feb 8 2016 
Answer : 

Answered By : 
null Replied Date : Feb 11 2016 
Answer : 

Answered By : 
null Replied Date : Feb 14 2016 
Answer : 

Answered By : 
null Replied Date : Feb 26 2016 
Answer : 

Answered By : 
null Replied Date : Feb 27 2016 
Answer : 

Answered By : 
null Replied Date : Mar 1 2016 
Answer : 

Answered By : 
null Replied Date : Mar 3 2016 
Answer : 

Answered By : 
null Replied Date : Mar 13 2016 
Answer : 

Answered By : 
null Replied Date : Mar 21 2016 
Answer : 

Answered By : 
null Replied Date : Mar 25 2016 
Answer : 

Answered By : 
null Replied Date : Mar 27 2016 
Answer : 

Answered By : 
null Replied Date : Apr 3 2016 
Answer : 

Answered By : 
null Replied Date : Apr 7 2016 
Answer : 

Answered By : 
null Replied Date : Apr 7 2016 
Answer : 

Answered By : 
null Replied Date : Apr 7 2016 
Answer : 

Answered By : 
null Replied Date : Apr 9 2016 
Answer : 

Answered By : 
null Replied Date : Apr 9 2016 
Answer : 

Answered By : 
null Replied Date : Apr 9 2016 
Answer : 

Answered By : 
null Replied Date : Apr 11 2016 
Answer : 

Answered By : 
null Replied Date : Apr 12 2016 
Answer : 

Answered By : 
null Replied Date : Apr 12 2016 
Answer : 

Answered By : 
null Replied Date : Apr 14 2016 
Answer : 

Answered By : 
null Replied Date : Apr 14 2016 
Answer : 

Answered By : 
null Replied Date : Apr 14 2016 
Answer : 

Answered By : 
null Replied Date : Apr 16 2016 
Answer : 

Answered By : 
null Replied Date : Apr 20 2016 
Answer : 

Answered By : 
null Replied Date : Apr 21 2016 
Answer : 

Answered By : 
asdasd Replied Date : Apr 22 2016 
Answer : 
asaSas

Answered By : 
dd Replied Date : Apr 22 2016 
Answer : 
ans is currect and work it...

Answered By : 
null Replied Date : Apr 23 2016 
Answer : 

Answered By : 
null Replied Date : Apr 25 2016 
Answer : 

Answered By : 
null Replied Date : Apr 27 2016 
Answer : 

Answered By : 
null Replied Date : Apr 30 2016 
Answer : 

Answered By : 
null Replied Date : May 2 2016 
Answer : 

Answered By : 
null Replied Date : May 4 2016 
Answer : 

Answered By : 
null Replied Date : May 6 2016 
Answer : 

Answered By : 
null Replied Date : May 6 2016 
Answer : 

Answered By : 
null Replied Date : May 6 2016 
Answer : 

Answered By : 
null Replied Date : May 17 2016 
Answer : 

Answered By : 
null Replied Date : Jun 23 2016 
Answer : 

Answered By : 
null Replied Date : Aug 19 2016 
Answer : 

Answered By : 
null Replied Date : Aug 22 2016 
Answer : 

Answered By : 
null Replied Date : Aug 22 2016 
Answer : 

Answered By : 
null Replied Date : Aug 27 2016 
Answer : 

Answered By : 
null Replied Date : Aug 29 2016 
Answer : 

Answered By : 
null Replied Date : Sep 28 2016 
Answer : 

Answered By : 
null Replied Date : Sep 29 2016 
Answer : 

Answered By : 
null Replied Date : Sep 30 2016 
Answer : 

Answered By : 
xxx Replied Date : Oct 25 2016 
Answer : 
Create a procedure to get an input value. Check whether it is an odd or even. If odd return 1 else
return 0. Use INOUT parameter. Input/output in a single variable.

Answered By : 
null Replied Date : Nov 9 2016 
Answer : 

Answered By : 
null Replied Date : Nov 12 2016 
Answer : 

Answered By : 
null Replied Date : Nov 13 2016 
Answer : 

Answered By : 
null Replied Date : Nov 14 2016 
Answer : 

Answered By : 
null Replied Date : Nov 20 2016 
Answer : 

Answered By : 
null Replied Date : Nov 20 2016 
Answer : 

Answered By : 
null Replied Date : Nov 24 2016 
Answer : 

Answered By : 
null Replied Date : Nov 24 2016 
Answer : 

Answered By : 
null Replied Date : Nov 24 2016 
Answer : 

Answered By : 
null Replied Date : Dec 12 2016 
Answer : 

Answered By : 
null Replied Date : Jan 9 2017 
Answer : 

Answered By : 
null Replied Date : Jan 20 2017 
Answer : 

Answered By : 
null Replied Date : Jan 22 2017 
Answer : 

Answered By : 
null Replied Date : Feb 7 2017 
Answer : 

Answered By : 
null Replied Date : Feb 16 2017 
Answer : 

Answered By : 
null Replied Date : Feb 17 2017 
Answer : 

Answered By : 
null Replied Date : Feb 25 2017 
Answer : 

Answered By : 
null Replied Date : Mar 18 2017 
Answer : 

Answered By : 
null Replied Date : Mar 27 2017 
Answer : 

Answered By : 
null Replied Date : Apr 8 2017 
Answer : 

Answered By : 
null Replied Date : Apr 9 2017 
Answer : 

Answered By : 
null Replied Date : Apr 11 2017 
Answer : 

Answered By : 
null Replied Date : Apr 13 2017 
Answer : 

Answered By : 
null Replied Date : Apr 30 2017 
Answer : 

Answered By : 
null Replied Date : May 11 2017 
Answer : 

Answered By : 
null Replied Date : May 13 2017 
Answer : 

Answered By : 
null Replied Date : Jun 1 2017 
Answer : 

Answered By : 
null Replied Date : Jun 11 2017 
Answer : 

Answered By : 
null Replied Date : Jul 3 2017 
Answer : 

Answered By : 
null Replied Date : Jul 15 2017 
Answer : 

Answered By : 
Abhishek Goti Replied Date : Jul 26 2017 
Answer : 
set serveroutput on;
declare
vno number;
begin
vno:=&vno;
if mod(vno,2)=0 then
dbms_output.put_line(vno'your selected number is even');
dbms_output.put_line(vno'your selected number is odd');
end if;
end;
/
