C++ Question Confused

the program works great, but why does my A[scii] not working as I enter "a" im confused about it.

#include <iostream>
#include <iomanip>
#include <ctime>
#include <fstream>


void ascii (int number);
bool raffle (int number);

using namespace std;

int main()
{


int number;
char select;


ofstream output("c:/Text6.txt", ios::out);


cout<<endl;
cout<<"Please enter a positive integer number: ";
cin>>number;
cout<<endl;


cout<<"A[scii]\t\tR[affle]\t\tE[xit]";
cout<<endl;
cout<<"Please select an option:";
cin>>select;
cout<<endl;

switch (select)

{
case 'a':
case 'A':
ascii(number);
break;

case 'r':
case 'R':

if(raffle(number)==true);
output<<"The number "<<number<<" is present in the array";
output.close();
break;




if(raffle(number)==false);
output<<"The number "<<number<<" is not present in the array";
output.close();
break;



case 'e':
case 'E':
return 0;

}

}


void ascii (int number)

{
if(number>47 && number<58)
cout<<"The number corresponds to a digit"<<endl<<endl;
else
if(number>64 && number<90)
cout<<"The number corresponds to a uppercase letter"<<endl<<endl;
else
if(number>96 && number<123)
cout<<"The number corresponds to a lowercase letter"<<endl<<endl;
else
cout<<"The number does not correspond to uppercase letter, lowercase letter, or digit"<<endl<<endl;

}



bool raffle(int number)

{

int array[6];
int count=0;
srand(time(NULL));

for(int i=0; i<5; i++)
{
array[i]=rand() % 101;
cout<<setw(8)<<array[i];
}

cout<<endl;


for(int i=0; i<5; i++)
{
if(number==array[i])
{
cout<<endl;
cout<<"The number can be found in position "<<i+1<<" of the array"<<endl<<endl;
return true;
}
}


for(int i=0; i<5; i++)
{
if(number!=array[i])
{
cout<<endl;
cout<<"The number was not found in the array"<<endl<<endl;
return false;
}
}

}
Please wrap your code [code]between code tags[/code] to make it easier to read.

Also, I am confused by your question... Could you point to a specific line?
Topic archived. No new replies allowed.