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 is the covariant return type?

1070


What is linkedlist in java?

981


what are different ways in which a thread can enter the waiting state? : Java thread

949


What is the difference between this() and super() in java?

1025


What is bubble sort in java?

1031


What is a numeric format?

1070


What is method with example?

1096


What is the difference between an inner class and a sub-class?

987


How variables are declared?

960


can used Protected Class outside Function.?

1085


What is the Concept of Encapsulation in OOPS

984


Can we override the static methods?

1018


What are parsing rules?

980


What is byte code and why is it important to java’s use for internet programming?

1106


What are the data types supported by java?

1007