Posted by: dzikrina on: July 24, 2008
// find the right most number
# include <iostream>
using namespace std;
int main ()
{
int num1, num2;
num1 = 1000;
num2 = 209;
cout <<”the rightmost number of num1 is “<<num1%10<<endl;
cout <<”the rightmost number of num2 is “<<num2%10<<endl;
system (“pause”);
return 0;
}
or you can use this one
// find the right most number
# include <iostream>
using namespace std;
int main ()
{
int num1, num2;
num1 = 1000;
num2 = 209;
cout <<num1<<” % 10 = “<<num1%10<<endl;
cout <<num2<<” % 10 = “<<num2%10<<endl;
system (“pause”);
return 0;
}
Why ???
i think my comment isn’t same as the comments above !!
is it something wrong??
July 27, 2008 at 2:30 am
C++…hmmm…..i haven’t study it yet…….but, i think for the problem above, it is more effective if we use function. Here is the example in C-language :
int main()
{
int num[2];
for(i=0;i numB)
{
return (numA);
}else{
return (numB);
}
}