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

What is the meaning of variables in research?

975


Why local variables are stored in stack?

916


what is the constructor and how many types of constructors are used in java?

946


What are implicit objects in java?

932


How does callback work in java?

993


which one is more efficient int x; 1. if(x==null) 2.if(null==x) state which one either 1 or 2?

10942


What is difference between path and classpath in java?

947


Can we call virtual funciton in a constructor ?

2134


Is singleton class thread safe?

948


What are static blocks in java ?

1039


What is linkedlist in java?

929


What does g mean in regex?

931


How do I enable java in safari?

978


How to print nodes of a Binary tree?

2198


What is set and get methods in java?

923