• Post Reply Bookmark Topic Watch Topic
  • New Topic

print out true and false, 1 and 0?  RSS feed

 
Yevgeniy Kim
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello dear programmers do samostayatelno the book can`t solve the problem, what would
Instead of true and false, 1 and 0 were displayed. Thank you in advance to all the best of luck to you, creative and career growth.
At the bottom, the task of its fragment:

 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You forgot about the code tags, but don't worry. I added them and doesn't the post look better now.
How on earth can you get that program to print 0/1? I tried your code and it printed
P Q AND OR XOR NOT
true true true true false false
false true false true true true
false true false true true true
false false false false false true
Please explain how you are running the code.
 
Campbell Ritchie
Marshal
Posts: 56536
172
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to get 1/0 rather than true/false, you can write this sort of method:-
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!