P
pitamber kumar
Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
than 100 & less than 200 that are divisible by 7.
We are not supposed to do your homework.pitamber said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
pitamber said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
pitamber kumar said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
Done.
Now it's your turn.
(No, we will not do your homework for you.)
pitamber kumar said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
pitamber said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
pitamber said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
pitamber said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
Eric said:Here you go. Invoke it exactly as described in the
"Usage" message, or it may misbehave.
Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
Johannes said:Eric said:Here you go. Invoke it exactly as described in the
"Usage" message, or it may misbehave.
Humm, I did. It reports, after printing argv[¹]:
XIV, MMCVII
That's not quite the solution - am I misunderstanding something here?
pitamber said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
Johannes said:XIV, MMCVII
That's not quite the solution - am I misunderstanding something here?
Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
Johannes Bauer said:Johannes said:XIV, MMCVII
That's not quite the solution - am I misunderstanding something here?
Yes I am! My program is broken. I didn't read the instructions throughly
enough. Oh well. :-/
Here it goes again:
q=0; z=0; i=101; while [ $i -lt 200 ]; do if [ $(($i%7)) -eq 0 ]; then
z=$(($z+$i)); q=$(($q+1)); fi; i=$(($i+1)); done; echo $q $z
bash/ksh shell.Bartc said:Johannes Bauer said:Yes I am! My program is broken. I didn't read the instructions throughlyJohannes said:XIV, MMCVII
That's not quite the solution - am I misunderstanding something here?
enough. Oh well. :-/
Here it goes again:
q=0; z=0; i=101; while [ $i -lt 200 ]; do if [ $(($i%7)) -eq 0 ]; then
z=$(($z+$i)); q=$(($q+1)); fi; i=$(($i+1)); done; echo $q $z
What language is this in? It's obviously not C, but apparently not Perl
either.
Johannes Bauer said:Johannes said:XIV, MMCVII
That's not quite the solution - am I misunderstanding something here?
Yes I am! My program is broken. I didn't read the instructions throughly
enough. Oh well. :-/
Here it goes again:
q=0; z=0; i=101; while [ $i -lt 200 ]; do if [ $(($i%7)) -eq 0 ]; then
z=$(($z+$i)); q=$(($q+1)); fi; i=$(($i+1)); done; echo $q $z
What language is this in? It's obviously not C, but apparently not Perl
either.
pitamber kumar said:Write a program to find the number of and sum of all intergers greater
than 100 & less than 200 that are divisible by 7.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.