make 1 digit output as 4
1 2 3 4 5 6
|
char* DateType::getYear(int y)
{
if(y == 1)
return "2001";
}
|
how to make it in such a way that... eg..
my input for y = 2
it will out put as 2
and y=20
will out put as 20
and so on and so forth.
eg:
1 2 3 4 5 6 7 8
|
key in year: 1
year entered: 2001
key in year: 25
year entered: 25
key in year: 335
year entered: 2335
|
"anything more than 4 digits" out put as what is being keyed upon~
Hello friend, I think might work
char* DateType::getYear(int y)
{
return(2000+y);
}
i've already found out the solution-thanks again.
Topic archived. No new replies allowed.