Question: Problem 2 . Write a code on a sequential function call of the following two function calls ( makeSum ( ) and makeMult ) in

Problem 2. Write a code on a sequential function call of the following two function calls (makeSum() and makeMult) in the main(). Measure the time in microseconds to execute the two function calls. Now use two threads one to run makeSum and other to run on makeMult. Now check the time in microseconds to execute only the threaded code. Report both the times in the submission.
```
void makeSum(){
long sum=0;
for(int i=1; i=1000000; i++)
sum +=i;
}
}
void makeMult(){
long mult=1;
for(int i=1; i=1000000; i++)
mult*=i;
}
}
```
Problem 2 . Write a code on a sequential function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!