1 AnswerNew Answer
you can use following data type for large numbers: long int x; long long int x; and if number is only expected to be positive : unsigned long int x; unsigned long long int x; Hope that helps.Thanks. Suggestion: you can make your loop efficient by checking if the given number is even or not(divisible by 2). If not then run a loop which jumps by two by all odd numbers which makes your code twice efficient then this one. Hope that helps.Thanks.