******** unf34 ********** rel=0; tot=0; for(i=1; i<=n; i++ ) for(j=i+1; j<=n; j++ ) { tot++; if( gcd(i,j) == 1 ) rel++; } printf("Percentage of relatively prime pairs is %lf\n", ( (double) rel ) /tot );