Skip to content

Instantly share code, notes, and snippets.

@telmen
Created March 22, 2023 14:31
Show Gist options
  • Save telmen/9666c983b9b3a842243cba827eda6d77 to your computer and use it in GitHub Desktop.
Save telmen/9666c983b9b3a842243cba827eda6d77 to your computer and use it in GitHub Desktop.
shinee
#include <stdio.h>
int *search(int arr[], int value, int size) {
for (int i = 0; i < n; i++) {
if (arr[i] == target) {
return &arr[i];
}
}
return NULL; // if element not found, return NULL
}
int main() {
int n;
printf("Heden elementtei array uusgeh ve: ");
scanf("%d", &n);
int arr[n];
int i, x;
printf("Enter the elements of array:\n");
for (i = 0; i < n; i++) {
scanf("%d", &arr[i]);
}
printf("Ymar elemenkkt baigaa esehiig shalgah ve:");
scanf("%d", &x);
int* result = search(arr, x, n);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment