0

I want to convert the number from decimal to hexadecimal number. The problems is the number is too big that cannot store in int datatype.For example,

int a = pow(10,17);

However, if I try to use double, I will face the problem of modulo operator because it does not support floating point datatype.

What should I do to convert it and store it? (Project Euler Problem Number 162).

MakaraPr
  • 73
  • 1
  • 8

1 Answers1

0

use can use long for that

To know the difference go Difference between long and int data types

You can convert int to long simply by

long variable=(long)a;

If that don't meet your requiremnet

You can use long long long long in C/C++

Conversion:

long long variable = (long long) a;
Community
  • 1
  • 1
Sajad Karuthedath
  • 14,987
  • 4
  • 32
  • 49