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 |
how to store 50 no of books in 9 racks.. condition 1.only store odd nos of books in every rack. 2. no rack will be empty&don`t store even no of books in a rack.
If 32+24=100 what no. system is used?
There are two trees in a lawn. One grows at a rate 3/5 of the other in 4 years. If the total growth of trees is 8 ft. What is the height of the smaller tree after 2 years? how can i get this answer...
The speed ratio of two trains is 5:7,first train is travelling at a speed of 350 km/hr, what is the speed of the second train?
Find the value of the 678 to the base 7.
How many 3 digits with 3 Distinct digits are there from 100-1000.
Which countries have two official national anthem ?
Pls send me which book to follow for SBI-clerical exam 2008
A man ate 100 bananas in five days, each day eating 6 more than the previous day. How many bananas did he eat on the first day?
A,H,S,I,?,H,D
Hello!!I have appllied for the post of Jr.Executive(ATC).My educational qualification is B.Tech(IT).I ould like to know if the questions in technical section will be based on IT alone or else also from other subjects also like electrical/electronics/civil/tele communication.I will be grateful for a relevant answer.thank you in advance
Complete the series. 3, 8, --, 24, --, 48, 63