Forking in C arrays

Please help me how to solve this problem (write a c program to search for a given value in array of numbers as follows) i tried solving it by the original way but it should be done using concept of forking in c language here's my code

#include <stdio.h>

int main()

{

int a[10000],i,n,key;

printf("Enter size of the array : ");

scanf("%d", &n);

printf("Enter elements in array : ");

for(i=0; i<n; i++)

{

scanf("%d",&a[i]);

}

printf("Enter the key : ");

scanf("%d", &key);

for(i=0; i<n; i++)

{

if(a[i]==key)

{

printf("element found ");

return 0;

}

}

Printf("element not found");

}

enter image description here



Read more here: https://stackoverflow.com/questions/67396495/forking-in-c-arrays

Content Attribution

This content was originally published by Eslam Ashraf at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: