fork(1) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. long long int N=pow(2, 36);
  8. cout << N <<endl;
  9. int count = 0;
  10. cout << "Positions where bits are set : " << endl;
  11. for(int j=0; j<sizeof(long long int)*8; ++j){
  12. if(N&(1<<j)){
  13. ++count;
  14. cout << j << endl;
  15. }
  16. }
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
68719476736
Positions where bits are set : 
31
63