how can i compute a code if i enter numbers then if i press any key its stops and computes the inputs of all no.
ongpong
0
Newbie Poster
Recommended Answers
Jump to PostWhat you might want to do is use two loops. One loop for storing each number, and another for printing each number.
#include <iostream> using namespace std; int main() { int y, s[100]; for ( y = 0 ; y < sizeof(s); y++ ) { cout << …
Jump to PostI would do something different and use a sentinel value to terminate input. Loop until users stops the loop.
int value, count=0, sum=0, total; for(;;) // out forever loop { for(;;) // { cout << "Enter value " << count+1 << ": "; value = -9999; cin …
Jump to Postthat's dumb.
what if he wants to add 9999 as one of his numbers
Jump to Postthat's dumb.
what if he wants to add 9999 as one of his numbers
Cool thanks for coming in offering no valuable input of your own just destructive criticism. If choosing 9999 is a problem he could use a different sent value it's just a suggestion.
Moron.
Jump to Postyes thats right! dont just ask and ask, just try it first to do by yourself. try and try until you cry. ;)
All 19 Replies
ongpong
0
Newbie Poster
nexocentric
18
Junior Poster in Training
Undermine
31
Light Poster
jephthah
1,888
Posting Maven
Undermine
31
Light Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
jephthah
1,888
Posting Maven
ongpong
0
Newbie Poster
jephthah
1,888
Posting Maven
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
ongpong
0
Newbie Poster
ongpong
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
valtikz
36
Junior Poster in Training
Ancient Dragon
commented:
Exactly :)
+36
ongpong
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
ongpong
0
Newbie Poster
Ancient Dragon
5,243
Achieved Level 70
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.