Programming Blog

This blog is about technical and programming questions and there solutions. I also cover programs that were asked in various interviews, it will help you to crack the coding round of various interviews

Monday 12 March 2018

Palindrome PLSQL

PL/SQL  code to check input number is palindrome or not



DECLARE


    no integer;
    dummy integer;
    temp integer :=0;
    

BEGIN

      no := &enter_numer;  --To take input from user
      dummy := no; 
      while(dummy !=0)
      loop
        temp :=(temp*10) +MOD(dummy ,10);
        dummy := dummy / 10;
        end loop;
        if temp = no then
        dbms_output.put_line('palindrome');
        else
          dbms_output.put_line('Not palindrome');
        end if;
        end;
        

No comments:

Post a Comment