0

Hi
I have to do this exercise for school, but i just dont know how to create this, so if anyone from you can please do this for me, i will be very thankful. It is a short one and quite simple(not for me):

"Write a program, which reads from numbers.dat numbers from 2000 to 3000. Between readable numbers find and printout the number with highest sum of numerical digits."

Thanks

2
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by radu84
0

have you wrote some code? post it here

the ideea is to have a cycle to read the numbers, after the number is read with another cycle you make the sum of it's digits

best regards,

0

Hi
Thanks for your answers, i was trying this with "varying" and no success at all. As im a complete rookie in this and need to do this for school by tomorrow, i would kindly ask you if you can write me the whole code, if its okay with you. I tried to do this, but i never get any success.
Thanks in advance

0

Hi
Thanks for your answers, i was trying this with "varying" and no success at all. As im a complete rookie in this and need to do this for school by tomorrow, i would kindly ask you if you can write me the whole code, if its okay with you. I tried to do this, but i never get any success.
Thanks in advance

so, for tomorrow...and when you expect to learn some programming? this is cheatting!
i will give you some instructions, but i can not give all the code, is not fair!


how to read numbers
num:=2100;
while (num<3000)and(num>2000) do
readln(num);

after this you make a cycle, and you find the digits of number by divinding it with 10, until the number is bigger than 10, and make the sum of digits.

0

I will learn it for my exams, which are 4 weeks away, i alredy know something, but for this excercise i have no clue. That is why i came to ask you if you can do it, but i`ll understand if you wont.

Thanks

0

my friend have you tried to open the program and to start to code? to came here and say: ok, i have done this and this. but here i can not figure out and ask for help

got my point?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.