0
What is a Boolean in the sense that how can you use it in code and give an example please
2 Respuestas
+ 1
Boolean has a value either true or false.
Ex: in c++,
bool b= true;
b=false;
You can use it according to your requirements.. As other data types..
Ex:
b=false;
if(num%2==0)
b=true;
if(b)
printf("even");
else
printf("odd") ;
0
#include <iostream>
using namespace std;
int main() {
int num=1;
while(num>10?false:true )
{
cout<<num++<<"\n";
}
return 0;
}