Answer:
Check the explanation
Explanation:
#define _MULTI_THREADED
#include <pthread.h>
#include <stdio.h>
#include <errno.h>
#define THREADS 2
int i=1,j,k,l;
int argcG;
char *argvG[1000];
void *threadfunc(void *parm)
{
int *num;
num=(int*)parm;
while(1)
{
if(i>=argcG)
break;
if(*num ==1)
if(argvG[i][0]=='a' ||argvG[i][0]=='2'||argvG[i][0]=='i' ||argvG[i][0]=='o' ||argvG[i][0]=='u')
{
printf("%s\n",argvG[i]);
i++;
continue;
}
if(*num ==2)
if(!(argvG[i][0]=='a' ||argvG[i][0]=='2'||argvG[i][0]=='i' ||argvG[i][0]=='o' ||argvG[i][0]=='u'))
{
printf("%s\n",argvG[i]);
i++;
continue;
}
sched_yield();
}
return NULL;
}
int main(int argc, char *argv[])
{
pthread_t threadid[THREADS];
int rc=0;
int loop=0;
int arr[2]={1,2};
argcG=argc;
for(rc=0;rc<argc;rc++)
argvG[rc]=argv[rc];
printf("Creating %d threads\n", THREADS);
for (loop=0; loop<THREADS; ++loop) {
rc =pthread_create(&threadid[loop], NULL, threadfunc,&arr[loop]);
}
for (loop=0; loop<THREADS; ++loop) {
rc = pthread_join(threadid[loop], NULL);
}
printf("Main completed\n");
return 0;
}
The below attached image is a sample output
Answer:
Binary sort
Explanation:
Binary sort is one of the fastest search techniques used on arrays and other iterable data types. It algorithm sorts the array in ascending order then gets the item in the middle from which it divides the array to be searched in two parts. If the searched term is less than the mid item, then it is searched for in the first part, else it would be in the second.
Answer:
The most common use of symbols by programmers is for performing language reflection (particularly for callbacks), and most common indirectly is their use to create object linkages. In the most trivial implementation, they have essentially named integers (e.g. the enumerated type in C).
<u>Help Me By Marking Me as Brainlist ...</u>
Answer:
Explanation:
#Using python to create the list
#first we create an empty list to store our numbers.
import math
data = []
x = 0
InputSum = 0
NumInput=int(input("how many number do you want to add"))
while x <=(NumInput):
Input=int(input("Enter the numbers here"))
data.append(Input)
x = x+1
InputSum = InputSum + Input #this is to add the numbers entered
print("The number you entered are ")
print(*data) #this print the numbers entered
print("The sum of the numbers is", InputSum)