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 / sadikhasan palsaniya

int no=687;
int sum=0;
int temp;

while(no>0)
{
temp = no % 10;
sum += temp;
no = no/10;
}
System.out.println(sum);

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Suppose if we have variable ' I ' in run method, if I can create one or more thread each thread will occupy a separate copy or same variable will be shared?

1130


How do you remove an element from an arraylist in java?

1076


What is number data type in java?

1076


What is an array length?

967


What is fail first in java?

1306


What is a lightweight component?

1070


Can a constructor call another constructor?

1049


What is substring in java?

1313


How to calculate the length of a singly linked list in java?

1098


What is difference between string and new string?

1082


Can a class have multiple subclasses?

1157


What is difference between classpath and path variables in java?

1266


Which collection is thread safe in java?

1041


Can we restart a dead thread in java?

1050


Which is the class in java?

1119