I am writing a program using an Array called words, when the user enters the word "END" the Array should output all the words pryor to that but for some reason all I get is the word "END" one time. Can anyone help me with this?
#include <iostream>
using namespace std;
int main( )
{
//Drill 4.
cout<<"THIS IS DRILL 4 "<< endl;
const int SIZE=3;
string words[SIZE];
string END;
for(int i=0;i<SIZE;i++)
{
cout<<"Enter a list of words: "<< endl;
cin>>words[i];
if(words[i]== END)
{
cout<<words[i]<<", ";
}
}
return 0;
}