From next number, start your loop. JavaTpoint offers too many high quality services. PHP Sum of Digits for beginners and professionals with examples, php file, php session, php date, php array, php form, functions, time, xml, ajax, php mysql, regex, string, oop ... To find sum of digits of a number just add all the digits. Logic: Initializing first and second number as 0 and 1. \$year = 2011; \$year = substr( \$year, -2); The above code gives 11 as a output which is the last two digit of 2011. share. This will correctly get the last 2 digits of the 2-digit number discarding the extra '0' added to it. . In MS Excel, it is easily possible with RIGHT() function but there is no-inbuilt function to do it in SAS. Other versions get the string from start. PHP Fibonacci Series for beginners and professionals with examples, php file, php session, php date, php array, php form, functions, time, xml, ajax, php mysql, regex, string, oop ... Fibonacci series is the one in which you will get your next term by adding previous two numbers. Accordingly, when having two-digit numbers we have to divide by 10, when having four-digit numbers by 1000. In a 4-digit number, the sum of the first two digits is equal to that of last two digits. Add Digits of Number. Earlier versions returns FALSE. Enter First Number:

. For example, Logic: Take the number. home Front End HTML CSS JavaScript HTML5 Schema.org php.js Twitter Bootstrap Responsive Web Design tutorial Zurb Foundation 3 tutorials Pure CSS HTML5 Canvas JavaScript Course Icon Angular React Vue Jest Mocha NPM Yarn Back End PHP Python Java Node.js Ruby C programming PHP Composer Laravel PHPUnit ASP.NET Database SQL(2003 standard of ANSI) ... Write a C program to … JS HOME JS Introduction JS Where To JS Output JS Statements JS Syntax JS Comments JS Variables JS Operators JS Arithmetic JS Assignment JS Data Types JS Functions JS Objects JS Events JS Strings JS String Methods JS Numbers JS Number Methods JS Arrays JS Array Methods JS Array Sort JS Array Iteration JS Dates JS Date Formats JS Date Get Methods JS Date Set Methods JS Math JS … first and then calculate the number of digits present in it.