I am just trying to do a problem in C that may give us 64 bit integers. It cannot support in displaying such big number. So what can i do?
#include<stdio.h> #include<string.h> #include<math.h> #include<stdlib.h> int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ long int a,b,n,c; scanf("%ld %ld %ld",&a,&b,&n); n-=2; while(n--){ c=(b*b)+a; a=b; b=c; } printf("%ld",c); return 0; }
long longwhich is at least 64-bit.