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 |
send some genaral aptitude questions to my email id- siva.maradana@yahoo.com
If 9x-3y=12 and 3x-5y=7 then 6x-2y = ?
This is on letter series like if DEFGHI: ABCDEF then NOPQRS:_______
11 Answers EA Electronic Arts, TS,
A machine puts c caps on bottles in m minutes. How many hours will it take to put caps on b bottles?
Plese give pattern on NIC Exam
APPSC Group-2 Previous Exam Papers
Find sqrt of 113 up to 3 decimal places.
You are driving along in your car on a wild, stormy night, it's raining heavily, when suddenly you pass by a bus stop, and you see three people waiting for a bus: An old lady who looks as if she is about to die. An old friend who once saved your life. The perfect partner you have been dreaming about. Which one would you choose to offer a ride to, knowing very well that there could only be one passenger in your car? This is a moral/ethical dilemma that was once actually used as part of a job application. * You could pick up the old lady, because she is going to die, and thus you should save her first; * or you could take the old friend because he once saved your life, and this would be the perfect chance to ! pay him back. * However, you may never be able to find your perfect mate again.
for cube and sphere 3 views are similarly draw one such figure?
From 7:00 AM to 11:00 AM it rained 2.25 inches. At 11:00 AM the rain increased to fall at a rate of 1.25 in. every two hours. How many inches of rain landed on the ground by 5:00 PM?
9 Answers Accenture, Patni, TCS,
An apple seller is having some apples. He is selling half of the apple what he has plus half the apple to the first customer. In the same way he sells the remaining apple to 7 customers. After selling to 7 customers, he has no apples with him.
Total distance is 120 km . Going by 60kmph and coming back by 40kmph what is the average speed?