Not at the moment as I'm traveling. Sorry. You could start with
http://en.wikipedia.org/wiki/Modular_arithmetic . The references
might be helpful.
I'll illustrate what I"m talking about. Let M=7. Then here is a
table of inverses and checks:
All mod 7 arithmetic
Inverse Check
1 ^ 5 = 1
could you refer a number theory book..?
On Tue, Mar 6, 2012 at 7:01 AM, Gene wrote:
> It's a fact from number theory that
>
> x * (x^(M-2)) = 1 (mod M)
>
> if M is prime. So x^(M-2) is the multiplicative inverse of x (mod
> M). It follows by identities of modulo arithmetic that
>
> n!/(r!(n-
It's a fact from number theory that
x * (x^(M-2)) = 1 (mod M)
if M is prime. So x^(M-2) is the multiplicative inverse of x (mod
M). It follows by identities of modulo arithmetic that
n!/(r!(n-r)!) = n! * inv(r!) * inv( (n-r)! ) (mod M)
This is what the code is computing. A basic number
*yeah..i was wrong as i didn't notice (-) sign ..
*Thanking you
*With regards-
Raghav garg
Contact no. 9013201944
www.facebook.com/rock.raghavag
B. tech (IT), 5th sem
University School Of Information Technology
Guru Govind Singh Indraprastha University
Delhi*
On Sat, Oct 8, 2011 at 8:42 AM, ra
o/p : fail 1
between c and u they will be in range so stored as it is
but i is -16
converted to 2 complement n become -32
thats y
On Sat, Oct 8, 2011 at 2:02 AM, Rahul Tiwari wrote:
> o/p - fail1
>pass2
>
> xplaination - as char range = (-127 to +127) so char c=-64 is ok
> so (c>i) cond
o/p - fail1
pass2
xplaination - as char range = (-127 to +127) so char c=-64 is ok
so (c>i) condition z not true ..so else part got executed .
but u is unsigned so its actual value z , u = some very high + no.
so i wrote:
> i have run the program in turbo c and getting same o/p as
Output on gcc 4.3.x
being
bfed75a8
3
-1218278705
The First output is the address of the a[0] .
Here the function is returning a local address , so the output is compiler
dependent .
On Tue, Jul 19, 2011 at 8:42 PM, geek forgeek wrote:
> @schrodinger y a[] value is not lost in first call.it sh
@schrodinger y a[] value is not lost in first call.it should be lost in
first call only?
On Tue, Jul 19, 2011 at 8:24 PM, schrodinger <6fae1ce6347...@gmail.com>wrote:
> First output of memory location is fine.
> Second output is also expected one.
> Third output will vary compiler to compiler an
First output of memory location is fine.
Second output is also expected one.
Third output will vary compiler to compiler and from time to time.
This is because a[] is a local to fun(). First time when you call
printf("%d\n",r[0]) its fine. but after executing printf() location of r is
lost and
check the O/P :- https://ideone.com/p7pcv
Output:-
bfc9aae0 (this is always give correct address)
3 // may vary from compiler to compiler (garbage may also come)
3 // may vary from compiler to compiler
I think the o/p will depend from compiler to compiler .
--
You received this message
in 1st printf no. of characters written are 3 and 4 and 3 & 4
is 0 which is equal to i
next 3 printf are easy...
now in last printf no. of characters written by 2 printf(s) are 3 and
3 and 3 & 3 is 3 which is printed by outer printf
On Jun 29, 7:40 pm, ashwini singh wrote:
> please ex-pla
First the values are calculated from right to left and then the result is
printed from left to right. So the last output is 100 in gcc 4.0 compiler.
The ptr pointer is calculated initially and then printed. Try first
calculating from right to left...
On Wed, Jun 22, 2011 at 9:19 PM, udit sharma wr
May be it is compiler dependent.. :)
--
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
In any function call , the comma operator used is not a sequence point
so
the order of evaluation of the arguments sent to the function is not
defined .That
is why it is giving different output on different compilers.
On Jun 22, 7:29 pm, Piyush Sinha wrote:
> I am using Dev C++ its showing last o
This is depending on the precission of floating point number representation
(IEEE double pression or single precission ) and how it is handled by the
compilers)
On Thu, Jun 16, 2011 at 8:50 PM, Kamakshii Aggarwal
wrote:
> I have read this link,still i am not getting.Can anybody help??
>
> On 6/1
I have read this link,still my not getting.Can anybody help??
On 6/15/11, Maksym Melnychok wrote:
> that's floating point for you.
>
> http://en.wikipedia.org/wiki/Floating_point
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To vie
I have read this link,still i am not getting.Can anybody help??
On 6/16/11, Kamakshii Aggarwal wrote:
> I have read this link,still my not getting.Can anybody help??
>
> On 6/15/11, Maksym Melnychok wrote:
>> that's floating point for you.
>>
>> http://en.wikipedia.org/wiki/Floating_point
>>
>>
that's floating point for you.
http://en.wikipedia.org/wiki/Floating_point
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/algogeeks/-/RcduUpABmi8J.
To post to this gr
i have checked the code in broland 4.5..
i have changed some code and checked ...
int main()
{
*float a=275.6;*
printf("%.10f\n",a);//prints 275.7000122070 WHY???
if(275.7>a)
printf("Hi");
else
printf("Hello");
return 0;
}
output is 275.661035
and also look at this one as well..
int m
On 10 September 2010 16:25, saurabh agrawal wrote:
> Thanks a lot umesh...but still i am in confusion that:
>
> after first processing : "A is replaced by B"
> after second proecessing " B is replaced by A"
> then why again this A is not being replaced by #define A macro..
> why it is not going i
first all the preprocessor statementa are executed where all A's are replace
by B
now the code looks like
#include
int main(){
int B =4;
#define A B
#define B B
printf("%d",B);
return 0;
}
after words second preprocessor statement get executed and all B's by B get
replaced
#include
int main(){
in
Instead of blindly looking for answer, do "gcc -E yourfilename.c". It
will produce o/p after preprocessing. See what's happening there?
On Sep 10, 3:55 pm, saurabh agrawal wrote:
> Thanks a lot umesh...but still i am in confusion that:
>
> after first processing : "A is replaced by B"
> after sec
Thanks a lot umesh...but still i am in confusion that:
after first processing : "A is replaced by B"
after second proecessing " B is replaced by A"
then why again this A is not being replaced by #define A macro..
why it is not going in an infinite loop...because i think there is no fiexed
order of
HI,
Here are some fact related to macros..
its a preprocessor directory so before comping the code will replaced by
appropriate macros... these are not comping or executing ..so macros
replaced one by one and other fact macro will not replaced the content of
other macros...
so code of 1st code
After preprocessing
Where ever there is 'A' in your program, it is replaced by 'B'
Where ever there is 'B' in your program, it is replaced by 'B'
this will be the program look like
#include
int main(){
int B =4;
printf("%d",B);
return 0;
}
therefore, the program will compile and run :)
--
You
25 matches
Mail list logo