+ 1

How can I store such a large number in C

#include<stdio.h> #include<string.h> int main () { long long num; int n; int divisor; scanf ("%d", &n); num = (10000 * 100000000000000000000 * 100000000000000000000 * 100000000000000000000) if (1 < n && n < (num -1)) if (n % 9 == 0) printf ("divisibilidad!"); if else printf ("no es multiplo"); return 0; }

8th Nov 2019, 12:05 AM
Young Money
Young Money - avatar
4 odpowiedzi
+ 2
How large?
8th Nov 2019, 12:06 AM
HonFu
HonFu - avatar
+ 1
10^64-1
8th Nov 2019, 12:17 AM
Young Money
Young Money - avatar
+ 1
I think is too big for long long int type
8th Nov 2019, 5:10 AM
Пафусик
Пафусик - avatar
0
Try double. He's can have 10000000000000000000000000000000000, easy. But he cant have 10000000000000001 :-(
8th Nov 2019, 8:46 AM
Пафусик
Пафусик - avatar