Why don't you keep track of how many values the user has entered, and use some mechanism to see if that number's 10?
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
Example :
#include <iostream>
using namespace std;
int main()
{
int val[4] = {1,2,3,4};
int limit = 2;
for(int i = 0; i < limit; i++)
{
cout<<"Enter value : ";
cin >> val[i]
}
return 0;
}
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
hey can u pls edit in my program bcz i m really afraid tht i might mess up d whole program...it already took me too long to write the program...thank u n i appreciate ur help
Then copy and paste it into a text file, and save it. Then start playing around with it. If you mess up too much, then just copy and paste the
original content from the text file.
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608
hey can someone tell me how to make 10 nodes in the code tht i have made...thts the one way i could think of...
Try figuring it out yourself. Then maybe you'll learn something.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177
Before fixing your code, you should fix your grammar.
firstPerson
Senior Poster
3,923 posts since Dec 2008
Reputation Points: 841
Solved Threads: 608