How to print the value of the Boolean variable using printf() in Scala

1 Answer

0 votes
printf("Boolean = %b\n", true)
printf("Boolean = %b\n", false)

var b1:Boolean = true
var b2:Boolean = false
          
printf("b1: %b\n", b1) 
printf("b2: %b\n", b2) 

 
 
/*
run:
   
Boolean = true
Boolean = false
b1: true
b2: false
 
*/

 



answered Dec 1, 2024 by avibootz

Related questions

1 answer 189 views
1 answer 200 views
200 views asked Oct 18, 2021 by avibootz
2 answers 107 views
107 views asked Sep 23, 2024 by avibootz
1 answer 158 views
2 answers 99 views
...