On Thu, Apr 14, 2011 at 9:08 PM, Dave <dave_and_da...@juno.com> wrote:

> @AAmir: The easiest way is to declare A as long long int. Be sure to
> change the printf format string.
>
> I know that. But since i want to have only the last 9 digits of the answer
that can be accommodated in int only so there is no need for long long i
think.

>  Dave
>
> On Apr 14, 8:31 am, AAMIR KHAN <ak4u2...@gmail.com> wrote:
> > #include<cstdio>
> > #define MOD (int)1e9
> > using namespace std;
> > int main() {
> >    int A = 33554432;
> >    printf("%d\n",A*A);
> >    printf("%d\n",((A*A)%MOD));
> >    return 0;
> >
> > }
> >
> > How can i calculate, lets say last 9 digits of square of 33554432 ?
> >
> > Thanks,
> > Aamir
>
> --
> 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.
>
>

-- 
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.

Reply via email to