From: Jesse H. <jes...@gm...> - 2004-06-21 19:58:41
|
Provided number is an integer, number / 10000 =3D=3D 1st digit (55255 / 10000 =3D 5) number % 10 =3D=3D 5th digit (55255 % 10 =3D 5) if (number/10000) =3D=3D (number%10)) checks if the first and last digits a= re equal. (number/1000)%10 =3D=3D 2nd digit (number/10)%10) =3D=3D 4th digit if (number/1000)%10 =3D=3D (number/10)%10 checks if the second and fourth digits are equal. The third digit can be ignored... Cheerio! On Mon, 21 Jun 2004 15:45:12 -0400, dirty dragon <dir...@ms...> w= rote: >=20 > can someone please explain the significance of the second if statement? > thnx pete >=20 > if((number>=3D10000 && number <100000)) >=20 > { > if (((number/10000) =3D=3D (number%10)) && (((number/1000)%10) =3D=3D ((n= umber/10) > %10))) >=20 > cout<<number<<" is a palindrome"<<endl; > else > cout <<number<<" is not palindrome"<<endl; >=20 > } > else{ > cout<<"You did not enter a 5-digit number!"<<endl; >=20 > _________________________________________________________________ > FREE pop-up blocking with the new MSN Toolbar =96 get it now! > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ >=20 > ------------------------------------------------------- > This SF.Net email sponsored by Black Hat Briefings & Training. > Attend Black Hat Briefings & Training, Las Vegas July 24-29 - > digital self defense, top technical experts, no vendor pitches, > unmatched networking opportunities. Visit www.blackhat.com > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 --=20 Jesse Hallam University of Waterloo Freshman |