Maximum limit of unsigned long long

guys,a little help here,when i assign a value to the unsigned long long ,the compiler shows ,integer constant is too large for long type…but the strange thing is if i enter the same value using cin,then it is working fine …can anybody tell me what to do here…i want to store the values beforehand…

#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
unsigned long long int a;
a=916312070471295267;
//cin>>a;
cout<<a;
return 0;
}

you can use,

a=916312070471295267ULL;
4 Likes

thanks…it worked…

Why don’t you use?

std::cout << std::numeric_limits<unsigned long long>::max() << '\n';
1 Like
//