Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

if num=687;
U have to get
num=6+8+7;

Answer Posted / asit

public class addDigit {
public static void main(String args[])
{
int num=56782;
int sum=0;
while(num!=0)
{
sum=sum+num%10;
num=num/10;
}
System.out.print(sum);
}

}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What mechanism does java use for memory management?

979


What is a linkedhashmap java?

1006


Difference between static binding and dynamic binding?

1114


Is call by reference possible in java?

967


Explain about fail safe iterators in java?

1030


What is difference between public static and void?

1022


What is the difference between an object-oriented programming language and object-based programming language?

1013


What is the gregoriancalendar class in java programming?

1045


Explain how to convert any java object into byte array.

980


Difference between this() and super() ?

1121


What does function identity () do?

969


Does hashset allow duplicates in java?

1127


What are sets in java?

952


How can I debug the Java security exceptions and AccessControlExceptions?

1156


How to use arraylist in java netbeans?

1046