I have made a C program of 2^0 + 2^1 + 2^2 + 2^3 +......... 2^64. My problem is that such a big value is not being stored. Which data type should I use? Here is my code:
#include<stdio.h>
#include<conio.h>
void main()
{
int i;
int number=2;
int total=1;
int power=64;
int totalSum=1;
for(i=1;i<=power;)
{
total=total*number;
totalSum=totalSum+total;
i++;
}
printf("%d\n",total);
printf("Sum=%d",totalSum);
}
Kindly can you please tell me that which type of data type should I use i C language