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 |
431 x 32(probably ) is represented by 15356(probably) in some number system ki what will it represent when converted from that system to decimal.
Which actor played the role of Mahatama Gandhi in the film 'Gandhi'? a)Paresh rawal b) ben kingsley c) abhijit
Information about "Jeane D Arc" and picture?
A person has to cover the fixed distance through his horses. There are five horses in the cart. They ran at the full potential for the 24 hours continuously at constant speed and then two of the horses ran away to some other direction. So he reached the destination 48 hours behind the schedule. If the five horses would have run 50 miles more, then the person would have been only 24 hours late. Find the distance of the destination.
A man walks from 9.15 to 5.15 from monday to friday and 9.00 to 12.00 on saturday.Each day 0.45 min lunch. How much time he walks in a week
Find the next letter in the series B,F,J,P ---
A can have a piece of work done in 8 days, B can work three times faster than the A, C can work five times faster than A. How many days will they take to do the work together ?
Number Series 10,2,8,2,6,2,?
Perimeter of the back wheel = 9 feet, front wheel = 7 feet on a certain distance, the front wheel gets 10 revolutions more than the back wheel .What is the distance?
8 Answers 3i Infotech, C DAC, Canara Bank, CMC, GE, Geodesic, Infosys, TCS,
15 : 50 :: 18 : ? (A) 55 (B) 59 (C) 64 (D) 62 answer is 59 but how?
(165)2 - (164)2 =
A student is ranked 13th from right and 8th from left. How many students are there in totality ?