Well my following code is accepted but i have a doubt.When i try to submit it using #define and not by declaring “mod”(refer code) as a variable,it is giving a compilation error.Why is it so?Please help.
dont put a semi-colon after the define statement…i.e. define like this:-
#define MOD 1000000007
hope this helps…
1 Like
Preprocessor would replace
ans=((a[0])%mod)%mod;
by
ans=((a[0])%1000000007;)%1000000007;;
and you can see it is invalid.
Preprocessor directives are delimited by line breaks and not semi-colons.
1 Like
thnx kunal361 and bugkiller
If you’re done with this question, hit green tick on any answer and then close the question.