DECLARE
X NUMBER := '&Number';
Y NUMBER := 0;
Z VARCHAR2(1000);
BEGIN
WHILE X > 0 LOOP
Y := MOD(X,2);
Z := Y||Z;
X := TRUNC(X/2);
END LOOP;
DBMS_OUTPUT.put_line('Bianry Output for this decimal '||X ||' number is '||Z);
END;
X NUMBER := '&Number';
Y NUMBER := 0;
Z VARCHAR2(1000);
BEGIN
WHILE X > 0 LOOP
Y := MOD(X,2);
Z := Y||Z;
X := TRUNC(X/2);
END LOOP;
DBMS_OUTPUT.put_line('Bianry Output for this decimal '||X ||' number is '||Z);
END;
No comments:
Post a Comment