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 |
E=I*I*R what is the effect of E when I becomes I/2
If a and b are positive integers, is a + 4b odd? 1) b is even. 2) a is odd. a) if statement (1) ALONE is sufficient, but statement (2) alone is not sufficient to answer the question. b) if statement (2) ALONE is sufficient, but statement (1) alone is not sufficient to answer the question. c) if BOTH statements (1) and (2) TOGETHER are sufficient to answer the question asked, but NEITHER statement ALONE is sufficient. d) if EACH statement ALONE is sufficient to answer the question asked. e) if statements (1) and (2) TOGETHER are NOT sufficient to answer the question asked, and additional data specific to the problem are needed.
heat loss from a surface can be minimized by?
Sir, I'm sonjoy bhadra, plz send me previous 10 years solved question papers for sbi clarical exam and also send one model paper pattern for this year
If a ball falls from 16 feet takes 4 seconds. How much time it will take when falls from 64 feets.
The ratio for Boys to Girls is 6:4. 60% of the boys and 40% of girls take lunch in the canteen. What % of class takes lunch in canteen.
Four of the following five are alike in a certain way and so form a group. Which is the one that does not belong to that group? (a) 17 (b) 23 (c) 37 (d) 13 (e) 73
. In june a baseball team that played 60 games had won 30% of its game played. After a phenomenal winning streak this team raised its average to 50% .How many games must the team have won in a row to attain this average?
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?
Find the hypotaneous of a right angle isosceles triangle whose area is 50.
2+3=8, 3+7=27, 4+5=32, 5+8=60, 6+7=60, 7+8=? Reply t answer...
26 Answers ABC, Aditya Birla, Banking, Budget Signs,
If a salesman's average is a new order every other week, he will break the office record of the year. However, after 28 weeks, he is six orders behind schedule. In what proportion of the remaining weeks does he have to obtain a new order to break the record?