Created
March 22, 2023 14:31
-
-
Save telmen/9666c983b9b3a842243cba827eda6d77 to your computer and use it in GitHub Desktop.
shinee
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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