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 / sai

int num=687;
int sum=0;

int i;

System.out.println(num);
for(i=num;(sum>=0)&&(i>0);){
//System.out.println(i);
i=num%10;
System.out.println(i);
sum+=i;
//System.out.println(sum);
num/=10;
//System.out.println(i);
}
System.out.println(sum);

Is This Answer Correct ?    10 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there is any difference between a scrollbar and a scrollpane?

979


What is a parameter in simple terms?

976


What are the library functions in java?

1030


Is integer a class?

1061


When should we create our own custom exception classes?

1000


What is a file pointer?

1050


What is parse method?

994


What is the common usage of serialization? What exceptions occur during serialization?

1097


What is passing by reference in java?

1003


how is final different from finally and finalize in java?

1040


What is the purpose of default constructor?

988


What is main string [] args?

973


What is the meaning of 3 dots in java?

1149


Explain the significance of listiterator.

1082


Is it possible for yielded thread to get chance for its execution again ?

1010