Explain the logic
k=num%10;
sum=sum+k;
num=num/10;
Answers were Sorted based on User's Feedback
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 |
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 |
Ms. Neelam deposits an amount of Rs. 16420 at simple interest and obtained 25451 at the end of 5 years. What was the rate of interest per year?
On Monday a banker processed a batch of cheques, on Tuesday she processed three times as many, and on Wednesday she processed 4000 cheques. In the three days, she processed 16000 cheques. How many did she process on Tuesday?
The LCM of two numbers is 60. The sum of the numbers is 50. What are the numbers?
Find the hypotaneous of a right angle isoceles tringle whose area is 50.
Information on Pratibha Patil and Abrahim Hincoln?
Find the next series number 1, 1, 2, 3, 6, 7, 10, 11, ?
Work can be done by 8 men and 10 women in 25 days, the same work can be done by 10 children and 5 women . in how many days 2 children and 3 men can do the work?
A certain number of men can finish a piece of work in 10 days. If however there were 10 men less it will take 10 days more for the work to be finished. How many men were there originally?
A son and father go for boating in river upstream. After rowing for 1 mile son notices the hat of his father falling in the river. After 5 min. he tells his father that his hat has fallen. So they turn around and are able to pick the hat at the point from where they began boating after 5 min. tell the speed of river.
If macros are disabled in a workbook, what do we do to enable them?
Sum of 1 to 40 is?
20% of a 6 litre solution and 60% of 4 litre solution are mixed. What percentage of the mixture of solution ?
0 Answers 3i Infotech, Canara Bank, Geodesic, Mu Sigma,