fork download
  1. # include <iostream>
  2. # include <math.h>
  3. # include <cmath>
  4. # include <stdio.h>
  5. # define Pi 3.14159265
  6.  
  7. using namespace std;
  8.  
  9. void tobin(int b)
  10. {
  11. scanf(%b);
  12. int i = 0;
  13. for(i = 31; i >= 0; i--){
  14. if((b & (1 << i)) != 0){
  15. printf("1");
  16. }else{
  17. printf("0");
  18. }
  19. }
  20. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
13
compilation info
prog.cpp: In function ‘void tobin(int)’:
prog.cpp:11:7: error: expected primary-expression before ‘%’ token
 scanf(%b);
       ^
stdout
Standard output is empty