I couldn't understand the code part

Can you explain the code in detail??

The outer loop is for traversing each possible subsets. The inner loop traverses each subset and the result is added according to the inclusion exclusion principle.

for(ll j=0;j<=7 ;j++) { if(i&(1<<j)) { denom=denom*prime[j]; } }

not cleared with the inner loop and how they are calculating the answer to it

we have taken those prime numbers which are at position where 1 is present in the current mask. Since we are traversing from 1 to 1<<subset so, we can get all possible subsets of prime numbers.