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 |
Rainbow has how many color. Odd man out.
A man engaged a servant on a condn that he’ll pay Rs 90 and also give him a bag at the end of the yr. He served for 9 months and was given a turban and Rs 65. So the price of turban is i. Rs : 10 19 0 55
9 Answers Accenture, Cap Gemini,
Ajay and Vijay ave their salaries in the ratio of 2:3. If each of their salaries are increased by Rs 4000, the new ration comes to be 40:57. How much is the present salary of Vijay?
what is the diode?
plese,send to me the sbi clarical bank exam form.
1 Answers State Bank Of India SBI, TCS,
11.The addition 742586 + 829430 = 1212016 is incorrect. It can be corrected by changing one digit d, wherever it occurs, to another digit e. Find sum of d and e. A. 6 [DCRU] B. 4 C. 10 D. 8
There are 3 persons Sudhir, Arvind, and Gauri. Sudhir lent cars to Arvind and Gauri as many as they had already. After some time Arvind gave as many cars to Sudhir and Gauri as many as they have. After sometime Gauri did the same thing. At the end of this transaction each one of them had 24. Find the cars each originally had.
A gets 10% more marks than B.Then B gets
3 Answers BirlaSoft, MNC, SSC,
A SUM OF MONEY DEVIDED IN 3 PARTS IN RATIO 4:6:9 IF THE LARGEST SHARE IS 1000 MORE THEN THE SMALLEST ONE WHAT IS THE TOTAL SUM?
A car wash can wash 8 cars in 18 minutes,At this rate, how many cars can the car wash wash in 3 hours?
6. A lady has fine gloves and hats in her closet- 18 blue- 32 red and 25 yellow. The lights are out and it is totally dark inspite of the darkness. She can make out the difference between a hat and a glove. She takes out an item out of the closet only if she is sure that if it is a glove. How many gloves must she take out to make sure she has a pair of each colour? a) 50 b) 8 c) 60 d) 42
8 Answers GHG, Honeywell, Microsoft, TCS, Wipro,
In 1978, a kg of paper was sold at Rs25/-. I f the paper rate increases at 1.5% more than inflation rate which is of 6.5% a year , then what wil be the cost of a kg of paper after 2 years? a)29.12 (b) 29.72 (c) 30.12 (d) 32.65 (e) none of these