Remainder When N divided by 2^M
scanf("%d", &T);
while(T--){
scanf("%d,%d", &N,&M);
printf("%d",N&~(~0 << M));
}
Uh, guys, in pretty much any language, it would be
N & (1 << M - 1)
Golfscript - 16 chars
~]1>2/{~2\?(&n}/
For a single pair or numbers this would sufficient
~2\?(&
By the way, the /
does not stand for division here :)