Skip to content

Instantly share code, notes, and snippets.

@suryansh011
Created September 23, 2021 16:29
Show Gist options
  • Save suryansh011/df82501e38fe6c0bd4240d552c6c3a61 to your computer and use it in GitHub Desktop.
Save suryansh011/df82501e38fe6c0bd4240d552c6c3a61 to your computer and use it in GitHub Desktop.
#include <stdio.h>
int main() {
int m, n, i, out;
scanf("%d", &m);
int arr[m];
for(i = 0; i < m; i++)
scanf("%d", &arr[i]);
scanf("%d", &n);
for(i = 0; i < m; i++)
if (arr[i] == n) {
out = i+1;
break;
}
else
out = -1;
printf("%d", out);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment