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
0.512 * 18902358 =?
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.
The lowest temperature in the night in a city A is 1/3 more than 1/2 the highest during the day. Sum of the lowest temperature and the highest temperature is 100 degrees. Then what is the low temp?
consider expression 'ab' . what happens when 'a' is divided by 'c' &'b' is multiplied by 'c'.
In a show, ticket numbers from 101 to 350 are made to sit consecutively. What is the probability that the number of the ticket, selected at random, will be a hundredth digit of 2?
When the angle a, b, c, d are given find ‘x’?
The local wind which blows down the Rockies in Canada is known as:?
There are two trees in a lawn. One grows at a rate 3/5 of the other in 4 years. If the total growth of trees What is the height of the smaller tree after 2 years
A chain is broken into three pieces of equal lengths containing 3 links each. It is taken to a blacksmith to join into a single continuous one. How many links are to to be opened to make it ?
There is a 14 digit credit card number in which every 3 consecutive digits add to 20. Here is a part of it.. Find the value of 'x'? _ _ _ 9 _ _ _ x _ _ _ 7 _ _
In the word ECONOMETRICS, if the first and second , third and forth ,forth and fifth, fifth and sixth words are interchanged up to the last letter, what would be the tenth letter from right?
What is the missing number in this series? 8 2 14 6 11 ? 14 6 18 12
A man spending half of his salary for house hold expenses, 1/4th for rent, 1/5th for travel expenses, a man deposits the rest in a bank. If his monthly deposits in the bank amount 50. What is his monthly salary ?
k, l are men who take home a salary of x, y respectively.the total amount taken home is
mukesh and anil ambani invested amount in business and made in the ration 17:13 and made some profits. if mukesh earned 800 rs more than anil. then what is the profit they have earned....?