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

What is an empty string in css?

1102


Can we execute a program without main() method?

1090


What is the difference between stored procedure & function?

1022


Define jre i.e. Java runtime environment?

1082


List down the methods and interfaces of collection class in java.

1036


Can we serialize static variables in java?

1147


Explain the difference between jdk, jre, and jvm?

1083


How do you escape a string?

1037


Where are global variables stored?

1012


what are synchronized methods and synchronized statements? : Java thread

1051


What is file in java?

1082


Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?

1086


What is fail fast in java?

1257


How to invoke external process in java.

1134


How to sort array of 0 and 1 in java?

1003