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...


Explain the logic
k=num%10;
sum=sum+k;
num=num/10;

Answers were Sorted based on User's Feedback



Explain the logic k=num%10; sum=sum+k; num=num/10; ..

Answer / rudrapathi

It is the logic for adding the digits of given number

for example no is 1234

output is 1+2+3+4=10

Is This Answer Correct ?    27 Yes 1 No

Explain the logic k=num%10; sum=sum+k; num=num/10; ..

Answer / bariki shanmukha[anantapuram,m

I wil take 3 variables such as,sum=0,k,num[IT REPRESENTS
GIVEN NUMBER BY THE USER].

itr1 itr2 itr3 itr4 itr5

k : - 4 3 2 1

sum: 0 4 7 9 10

num: 1234 123 12 1 0

like that exucution wil b starts which is above mentioned.

Is This Answer Correct ?    11 Yes 3 No

Explain the logic k=num%10; sum=sum+k; num=num/10; ..

Answer / cathie

reverse of a number

Is This Answer Correct ?    3 Yes 7 No

Post New Answer

More General Aptitude Interview Questions

If 10x coins are added to the no. of original coins he has (5y + 1) times more coins. Find out how many coins he had originally in terms of x and y

0 Answers   Changepond,


Number Series 7,16,9,15,11,14,?

15 Answers   TCS,


in space ship 5men are going1.doctor,drug asdditive 2.lady lawer has done crime 3.teacher emotinally imbalanced 4. 18 year old aeruonautical engineer 5. noble lauraut .suddenly some thing happend and oxygen is available to only three people to use which of three you choose

0 Answers   Cognizant,


Pipe A can fill a tank in 30 mins and Pipe B can fill it in 28 mins.If 3/4th of the tank is filled by Pipe B alone and both are opened, how much time is required by both the pipes to fill the tank completely ?

0 Answers   3i Infotech, Amazon, Canara Bank, Mu Sigma,


If 6 years are subtracted from the present age of the remainder is divided by 18, then the present age of his grandson Anup is obtained. If Anup is 2 years younger to Madan whose age is 5 years,then what is Gagan's present age?

3 Answers  


In a company 30% are supervisors and 40% employees are male if 60% of supervisors are male. What is the probability that a randomly chosen employee is a male or female?

0 Answers   TCS,


How many tangents can be drawn with in three circles if they do not lie with in each other

2 Answers   Geometric Software,


I sow her -__ airport At , on , in , across

2 Answers   Accenture,


A,H,S,I,?,H,D

4 Answers   Accenture, ICICI,


From its total income, an IT company spent Rs.20, 000 for marketing, half of the remainder on operations and had Rs.6000 left. What is the total income of the company?

1 Answers   Cap Gemini,


who among the following was the first european to encounter the cacoa plant from which chocolate is made

3 Answers   CDS,


what is the pattern for MAQ Software company

1 Answers   MAQ, MAQ Software,


Categories