Explain the logic
k=num%10;
sum=sum+k;
num=num/10;
Answer Posted / 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 |
Post New Answer View All Answers
Two cars are 15 kms apart. One is turning at a speed of 50kmph and the other at 40kmph . How much time will it take for the two cars to meet?
Two trains are travelline at equilateral .Train A is travelling in the direction of earths spin.Other train B is travelling in opposite direction of earths spin.Which trains wheels will wear first?and why?
No of financial emergency announced by president
Successive discounts of 10%, 20% and 20% are equal to a single discount of __
From the below mentioned options choose the number that comes to 15 when divided by 4 and added by 9?
If a bat costs Rs.30 in the year 1999 and Rs.250 in the year 2000.What is the percent increase in price?
"what category of job are you looking for and why"asked from an mep engineer.
a block of ice floats on water in a beaker, as the ice melts,the water level in the beaker will
A cloth merchant claims to sell is material at cost price but uses a scale which reads 1 meter for every 95 centimeter. Find the gain percent?
i need icet solved papers 2000 to 20010,and also mock papers,mock online
In a party man & his wife ,and there r 2 son with their wives, and every son has 4 children in his family .how manyperson r in party.
In a classroom, a student is ranked 12th from right and 9th from left. How many students are there in total?
In a colony there are some families. Each of them have children but different in numbers.Following are conditions ano of adult>no of sons>no of daughters>no of families. b>each sister must have atleast one brother and should have at the most 1 sister. no of children in one family exceeds the sum of no of children in the rest families. Tell the no of families.
A can do a piece of work in 20 days, which B can do in 12 days. In 9 days B does ¾ of the work. How many days will A take to finish the remaining work?
A team of 200 wagers undertakes building work of a bridge. The total time allocated to build the entire bridge is 20 days. After 10 days since start, 200 more wagers join the team and together the team completes the bridge in required time. If the original team do not get those 200 extra wagers, how many days they would be behind schedule to complete building the bridge.