What is wrong with this birth year finding application?

Hey, I'm going through but I can't figure out why this doesn't work/
#include <iostream>
#include <conio.h>

using namespace std;
string month;

unsigned int c,r,s;


int agefinding (unsigned int c)
{
int a;
cout << "What is your age? > ";
cin >> c;
return (c);
}

int monthfinding (unsigned int r)
{
cout << "Were you born on or before today's date in your birth year? > ";
cin >> month;
if (month=="no","No")
{
r = 2008;
return(r);
}
else
{
r = 2009;
return(r);
}
}
int main ()
{
int z,y;
z = agefinding (c);
y = monthfinding (r);

if (y-z<0)
{
cout << "You were born in " << abs(y-z) << " B.C.";
}
else if (y-z==0){

cout << "You were born in " << y-z << ". ....Jesus?";
}

else {
cout << "You were born in " << y-z << ".";
}

getch ();
return 0;
}


Under the monthfinding function, I can't get the "else" to work. I've switched the yes' to no's and vice versa but that doesn't do anything.

Thank in advance.

You cannot do

 
if( month == "no", "No" )


It does not do what you expect it does.

 
if( month == "no" || month == "No" )


Thanks a lot. Didn't know that :D All working now
Topic archived. No new replies allowed.