Notification texts go here Contact Us Buy Now!

Write a pl sql program to display count of digits of a given number [solved]

Write a pl sql program to display count of digits of a given number [solved] with easitest expalination and perfect output.
Please wait 0 seconds...
Scroll Down and click on Go to Link for destination
Congrats! Link is Generated

write a pl/sql program to print the sum of numbers from 1 to 100 :

Code

DECLARE
N NUMBER( 5 ):= :N; -- In some compiler it can be "&" for example &N.
CNT NUMBER:= 0 ;
R NUMBER( 2 ):= 0 ;
BEGIN
WHILE N != 0 
LOOP
R:=MOD(N, 10 );
CNT:=CNT+1 ;
N:=TRUNC(N/ 10 );
END LOOP;
DBMS_OUTPUT.PUT_LINE('NUMBER OF DIGITS OF GIVEN NUMBER IS '||CNT);
END;
/
  

output

NUMBER OF DIGITS OF GIVEN NUMBER IS 2

Statement processed.
  

Getting Info...

إرسال تعليق

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.