hi everyone
for my comp sci class i'm supposed to write a piece of code which will take in 10 ints and put them into an array of such size. unless the input is either a 3 or 7 in which case wats left of the array will be written with either number. i'm only havin trouble with printing out the array with the desired values.
i thought of using a for loop to obtain the values,
then a while loop to check wheter it is a seven or a three
fill in whats left of it with the respective numbers
and output it
the problem is that i am stuck with the cout << command because all i get when i run it is the address and if not able to figure out wats wrong at this point, i dont know how to figure out if my program is working correctly
PS: i think i comment too much
// THIS PROGRAM will take 10 numbers from user and put them into an array
// if any of them is a 3 then the rest of the array will be filled with 3's
// if any of them is a 7 then the what is left of the array will be filled 7's
/**PROCEDURE
* (a) declare an integer array of size 10, and
* (a1) ask user to enter up to 10 integers and
* (a2) put them into the array
* (b) if a 3 is ever entered, fill what is left with 3's and the program will stop
* (c) if a 7 is ever entered, fill what is left with 7's and the program will stop
**/
#include <iostream>
using namespace std;
int main(){
int data[10]; //(a)
int value=0;
//for(int i=0; i<10; i++){
for(int i=0; i<10; i++){
cout << "please enter up to ten integers: ";
cin >> value;
data[i] = value;
//while(value!=3){
//}
}
cout<<data;
return 0;
}