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 |
In a club there are certain no. of males and females. If 15 females are absent then no. of males will be twice that of females. If 45 males are absent then female strength will be 5 times that of males. Find no. of males actually present.
fridge cost R Rs,cover value is 5,discount d% then its new cost
what is the sum of 7 consecutive odd numbers with 27 as the fourth number
Plz help me to get Aptitute test questions for SBI Clerical exams.
0 Answers State Bank Of India SBI,
Sunny ate 100 apples in five days, each day eating 6 more than the previous day. How many apples did he eat on the first day?
Find the next letter in the series A,C,F,J,0--
6 women can do 75 units of work in 8 days by working 5hrs/day. In how many days can 4 women do 30 units of work by working 8hrs/day ?
who translated the novel NIL Darpan in English? a) Rabindranath Tagore b) Madhusudan Dutta C) Dinabandhu Mitra d) Bankim Chandra Chatterjee.
for cube and sphere 3 views are similarly draw one such figure?
How much area in sqmt of 14 fit dia cirlce???
Express 16 m/s into Km/hr
4 couples have a party.Depending on the set of statements,find who insulted whom and who is the host of the party.