Explain the logic
k=num%10;
sum=sum+k;
num=num/10;

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In China, Mao-Tse-Tung was responsible for organizing its people and taking China into success path. It evolved into a great economic power by improved industrial and economical statistics. China prospered in those years, but _________________

665


A building with height D shadow upto G. What is the height of a neighbouring building with a shadow of C feet.

895


USA + USSR = PEACE ; P + E + A + C + E = ?

1160


If x,y,z are three consecutive natural numbers, which of the following numbers should be x+y+z

724


if a man byes 1 lt of milk for 12 rs and mixes with 20% of water and sels it for rs 15 thgen what is percentage of gain

764






In a flight of 600 km, an aircraft was slowed down due to bad weather. Its average speed for the trip was reduced by 200 km/hr and the time of flight increased by 30 minutes. The duration of the fligh is?

1199


In a class composed of x girls and y boys what part of the class is composed of girls

809


Ram starts from A walking 2 km North and turns right and walks 4 km and turns right again and walks 4 km and turns right again and walks 4 km and meets Radha at Bwalking in the opposite direction to Ram . Which direction does Ram walk after the first turn?

1062


Mr. Jaweri decided to walk down the escalator on the station. He found that if he walks down 26 steps, he requires 30 seconds to reach the bottom. However, if he steps down 34 stairs he would only require 18 seconds to get to the bottom. If the time is measured from the moment the top step begins to descend to the time he steps off the last step at the bottom, find out the height of the stair way in steps?

751


A trip takes 6 hours to complete. After traveling 1/4 of an hour, 1 3/8hours, and 2 1/3 hours, how much time does need to complete the trip? There are 30 socks in a drawer. 60% of the socks are red and the rest are blue. What is the minimum number of socks that must be taken from the drawer without looking in order to be certain that atleast two blue socks have been chosen?

1609


Complete the sequence A, E ,I ,M ,Q ,U , _ , _?

680


Bactria double every 3 mins. It is N in 1 hour, when was it N/4?

798


I want the sbi clerical exam model papers

1822


The committee on sexual discrimination in the workplace has highlighted Supremo Company as a chief offender. Of the twenty senior executives in the firm, only one is a woman. And of the forty junior executives, only five are female. Supremo could best defend itself against the charges by showing that .ten times more men than women apply for jobs with the company all job applicants who were rejected had fewer qualifications than those accepted they pay the same salary to senior men and senior women male and female executives at the same level have the same qualifications

2215


in a school for a student out of a 100 he got 74 of average for 7 subjects and he got 79 marks in 8th subject. What is the average of all the subjects?

755