A 32-bit integer can not store numbers that large, so you need to use something with more than 32 bits. For your example, a 64-bit integer should work. Try using type "long long int". Some compilers call it __int64.
If you need something larger than your compiler provides, you can use an extended precision library such as NTL. Don On Feb 21, 8:40 am, Anurag Gupta <anurag.gupta...@gmail.com> wrote: > how can we take mod by a very large number > for example 10000000000283 > int mod = 10000000000283; > ans % mod > > is not working > > Please Help -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.