Skip to content

Instantly share code, notes, and snippets.

Karthik Jain krthkj

Block or report user

Report or block krthkj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@krthkj
krthkj / Assignment101.java
Last active Aug 26, 2019
Multi-Thread code - Value of Pi - Monte Carlo
View Assignment101.java
// Estimate the value of Pi using Monte-Carlo Method, using sequential program
package assignments;
public class Assignment101 {
public static void main(String[] args) {
int nThrows = 100000;
long startTime = System.currentTimeMillis();
double x = 0, y = 0;
int nSuccess = 0;
for (int i = 1; i <= nThrows; i++) {
x = Math.random();
You can’t perform that action at this time.