hi.i.hope u can help me..juz study during the holiday break..i dun understand this code..but i try to understand by myself...i am not sure either my understanding is correct or not.......
i got the output T,F,F,T,F,F,T,F ,F,T ..is it i have to plus the number with 4 then it should be like this.... 0,4,8,12,16,20, 24,28,32,36.... ..so after that,i have to consider the same numbers that will result the values zero when we modulus them with 2 and 3???(x%2==0 && x%3==0),right?? ?hope u understand it......can u please explain to me in details????plz reply me as soon as possible.......
#include <iostream>
using namespace std;
bool strange(int x);
int main()
{
int num=0;
while (num<=36)
{
if(strange(num) )
cout<<"True"<<e ndl;
else
cout<<"False"<< endl;
num=num+4;
}
return 0;
}
bool strange(int x)
{
if(x%2==0 && x%3==0)
return true;
else
return false;
}
.
i got the output T,F,F,T,F,F,T,F ,F,T ..is it i have to plus the number with 4 then it should be like this.... 0,4,8,12,16,20, 24,28,32,36.... ..so after that,i have to consider the same numbers that will result the values zero when we modulus them with 2 and 3???(x%2==0 && x%3==0),right?? ?hope u understand it......can u please explain to me in details????plz reply me as soon as possible.......
#include <iostream>
using namespace std;
bool strange(int x);
int main()
{
int num=0;
while (num<=36)
{
if(strange(num) )
cout<<"True"<<e ndl;
else
cout<<"False"<< endl;
num=num+4;
}
return 0;
}
bool strange(int x)
{
if(x%2==0 && x%3==0)
return true;
else
return false;
}
.
Comment