Você está na página 1de 6

Custom Search

Home Coding problems DS & Algo. ▾ Languages ▾ Web. ▾ Programs ▾ Aptitude ▾


Interview ▾ CS Subjects ▾ More ▾

Home » Java solved programs » Core java programs

java program to nd sum and product of all digits of a


number using class

In this program we will read a positive integer number and then calculate product of all
digits using a class. For example, if input number is 12345 - sum of all digits, product of all
digits will be 15 , 120
120.

Copy
Ads help us run this site
//Java program to find sum and product of all digits using class.
When you visit our site, pre-selected Manage Your Choices Continue to site
companies
import may access*and
java.util.* ; use certain
information on your device and about this
site to serve relevant ads or personalized
class
content.DigitsOpr
{
Information
privatethatintmay be used
num;
Purposes for storing information
Output:
Enter an +ve integer number:1234567
SUM of all digits: 28
PRODUCT of all digits: 5040

TOP Interview Coding Problems/Challenges

Run-length encoding ( nd/print frequency of letters in a string)


Sort an array of 0's, 1's and 2's in linear time complexity
Checking Anagrams (check whether two string is anagrams or not)
Relative sorting algorithm
Finding subarray with given sum
Find the level in a binary tree with given sum K
Check whether a Binary Tree is BST (Binary Search Tree) or not
1[0]1 Pattern Count
Capitalize rst and last letter of each word in a line
Ads Print
helpvertical
us runsum thisofsite
a binary tree
When Print Boundary
you visit our site, Sum of a Binary Tree Manage Your Choices
pre-selected Continue to site
companies may access and use
Reverse a single linked list certain
information on your device and about this
site toGreedy Strategy
serve relevant adstoorsolve major algorithm problems
personalized
content.
Job sequencing problem
Root to leaf
Information that Path
may be Sum
used
Purposes for storing
Exit Point information
in a Matrix
Find length of loop in a linked list
Toppers of Class
Print All Nodes that don't have Sibling
Transform to Sum Tree
Shortest Source to Destination Path

Java Programs, Java...


includehelp.com

Ads help us runJavaScript


this sitecode to
check number is...
When you visit our site, pre-selected
includehelp.com Manage Your Choices Continue to site
companies may access and use certain
information on your device and about this
site to serve relevant JavaScript | Code to
ads or personalized
content. declare an array and...
includehelp.com
Information that may be used
Purposes for storing information
JavaScript code to
check number is...
c ec u be s...
includehelp.com

User Login System in


Servlet and JSP by...
includehelp.com

Object as an Array in
Java
includehelp.com

JavaScript code to
check whether a...
includehelp.com

C++ program to check


whether a given...
includehelp.com

Python | Program to
print Odd and Even...
includehelp.com

Minimum swaps
required to sort an...
includehelp.com

Midpoint Circle
Algorithm
includehelp.com

Ad
1. Basic Java Programming
2. Basic Java Programs Asked in Interviews
3. Beginner Java Program

Comments and Discussions


Ads help us run this site
Ad: you
When Arevisit
yououra blogger? Join our Blogging forum.
site, pre-selected Manage Your Choices Continue to site
companies may access and use certain
information on your device and about this
site to serve relevant ads or personalized
content.
Information that may be used
Purposes for storing information
0 Comments www.includehelp.com 
1 Login

 Recommend t Tweet f Share Sort by Newest

Start the discussion…

LOG IN WITH OR SIGN UP WITH DISQUS ?

Name

Be the first to comment.

ALSO ON WWW.INCLUDEHELP.COM

Ellipse Algorithm | Computer Graphics Local Class with Example in C++


2 comments • 9 months ago 1 comment • 8 months ago
Shubham Dubey — A Mathematic topic is Мυsнαяяαғ Нυssαιη — Hello sir please help me.
Avataralways incomplete without an example(at Avatar
least).

Capitalize first and last letter of each word in as header file in C++
a line 2 comments • 6 months ago
3 comments • 6 months ago IncludeHelp — Thanks Debasis Jana (Bappa)
Mirko Schmidt — Thanks for your reply! This Avatarfor pointing the typo mistake - I have fixed it.
Avatarfor-loop is meant to replace the first for-loop in Keep visiting and …
your code, so "i" is the …

✉ Subscribe d Add Disqus to your siteAdd DisqusAdd 🔒 Disqus' Privacy PolicyPrivacy PolicyPrivacy

Ads help us run this site


When you visit our site, pre-selected Manage Your Choices Continue to site
companies may access and use certain
information on your device and about this
site to serve relevant ads or personalized
content.
Information that may be used
Purposes for storing information
Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing »
Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

ABOUT SECTION
» About us
» Contact us
» Feedback
» Privacy policy

STUDENT'S SECTION
» Internship
» Certi cates
» Content Writers of the Month

SUBSCRIBE
» Facebook
» LinkedIn
» Subscribe through email

© https://www.includehelp.com some rights reserved.

Ads help us run this site


When you visit our site, pre-selected Manage Your Choices Continue to site
companies may access and use certain
information on your device and about this
site to serve relevant ads or personalized
content.
Information that may be used
Purposes for storing information

Você também pode gostar