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

Why is java so popular?

1129


How do you find the maximum number from an array without comparing and sorting?

1127


What is a singleton class? Give a practical example of its usage.

1110


For class CFoo { }; what default methods will the compiler generate for you>?

1082


How does java enable high performance?

1158


You're given a Boolean 2D matrix, can you find the number of islands?

1116


What are the high-level thread states in java programming?

1064


Why stringbuffer is faster than string?

1047


This abstract class is correct ? abstract class A { public abstract void Disp(); public abstract void B() { } public absract virtual C() { } }

993


Give an example of use of pointers in java class.

1036


What does a za z0 9 mean?

1108


Explain about core java?

1132


Explain the difference between call by refrence and call by value?

1032


What does n mean?

1006


What about interthread communication and how it takes place in java?

1068