Answer:
The programming code can be found in the explanation part, please go through it.
Explanation:
Code:
#include<stdio.h>
#include<stdlib.h>
#include <pthread.h>
// function check whether a number
// is prime or not
int isPrime(int n)
{
// Corner case
if (n <= 1)
return 0;
// Check from 2 to n-1
for (int i = 2; i < n; i++)
if (n % i == 0)
return 0;
return 1;
}
void* printPrimes(void *vargp)
{
int *n = (int *)vargp;
int i=0;
for (i=2;i<=n;i++)
{
if (isPrime(i)) printf("%d\n", i);
}
}
// Driver Program
int main(int argc, char* argv[])
{
int n = atoi(argv[1]);
pthread_t tid;
pthread_create(&tid, NULL, printPrimes, (void *)n);
pthread_exit(NULL);
return 0;
}
Answer:
see explaination
Explanation:
MaxArray.java
public class MaxArray{
public static void main(String[] args) {
int a[] = {1,2,5,4,3};
int max = max (a, 5);
System.out.println("Max value is "+max);
}
public static int max (int a[],int size){
if (size > 0) {
return Math.max(a[size-1], max(a, size-1));
} else {
return a[0];
}
}
}
Output:
MaxArray
Answer:
0.03
Explanation:
3e-2 is in scientific notation, also known as standard form. Used to write large or small numbers in another way. In the number 3e-2, the numbers are defined as follows:
3 = coefficient
e = 10 to the power of
-2 = exponent
The scientific notation 3e-2 is same as 3 x 10^-2 or 3 x 10-2. Thus, to get the answer to 3e-2 as a decimal, we multiply 3 by 10 to the power of -2.
= 3e-2
= 3 × 10-2
= 0.03
Answer:
Series Circuit
Explanation:
A <em>series circuit</em> is a connection configuration in which the terminals or terminals of the devices (generators, resistors, capacitors, inductors, switches, light buls, among others) are connected successively, that is, the output terminal of a device is connected to the input terminal of the next device.
.
[C] Permitting oxygen and nutrients to be absorbed by cells.
The walls of capillaries are only one cell thick. This allows oxygen and other nutrients to pass through with each for the blood to use and carry to the respected parts of the body.