Explain the logic
k=num%10;
sum=sum+k;
num=num/10;
Answer Posted / 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 |
Post New Answer View All Answers
In 80 coins one coin is counterfeit what is minimum number of weighings to find out counterfeit coin
what is mean by aptitude test? how to write this paper?
If Dev walks 30 miles/hr. he reaches 1 hour before and if he walks with a speed of 20 miles/hr. he reach 1 hour late. Find the distance between 2 points and the exact time of reaching destination is 11 am then find the speed with which he walks.
There are 6 people W,H,M,C,G,F who are murderer , victim , judge , police, witness, hangman. There was no eye witness only circumtancial witness. The murderer was sentenced to death. Read following statement and determine who is who.
A ship went on a voyage.After it had travelled 180 miles a plane statrted with 10 times the speed of the ship. An army 50 miles long marches at a constant rate. A courier standing at the rear moves forward and delivers the message to the first person and then turns back and reaches the rear of the army as the army completes 50 miles. Find the distance travelled by the courier.
Integral ET(epsiolan transpose)*sigma*dV P=strain displacement vector Q=stress-strain deformation Find [K]
Time and speed time and work boat and streams
f(x,y) =x**2 -y**2 then the value of f(4,(f(1,2) is
If a car starts from A towards B with some velocity due to some problem in the engine after travelling 30km.If the car goes with 4/5 th of its actual velocity the car reaches B 45min later to the actual time. If the car engine fails after travelling 45km, the car reaches the destination B 36min late to the actual time , what is the initial velocity of car and what is the distance between A and B in km
There r 1200 elephant .some have blue and pink strips.some have pink & green strip. 400 ele. have only pink strip. how many have only blue strip
A person was fined for exceeding the speed limit by 10 mph. Another person was also fined for exceeding same speed limit by twice the same. If the second person was travelling at a speed of 35 mph, find the speed
In a colony there are some families. Each of them have children but different in numbers.Following are conditions ano of adult>no of sons>no of daughters>no of families. b>each sister must have atleast one brother and should have at the most 1 sister. no of children in one family exceeds the sum of no of children in the rest families. Tell the no of families.
A person with some money spends1/3 for cloths, 1/5 of the remaining for food and 1/4 of the remaining for travel. He is left with Rs 100/- . How much did he have with him in the beginning ?
A and B decide to speak truth or lie on a day. Another person asks A if he is saying truth or lie. B listens to A whatever he answers. Now the person asks B what A had told. B replies as " A has told that he is a liar". What does B say?
Find the hypotenuse of a right angle isoceles triangle whose area is 50.