#include<stdio.h>intfindIndex(int arr[],int n,int target){for(int i =0; i < n; i++){if(arr[i]== target){return i;}}return-1;}intmain(){int arr[]={1,5,3,8,2};int n =sizeof(arr)/sizeof(arr[0]);int target =3;int index =findIndex(arr, n, target);if(index !=-1){printf("Index of %d is %d\n", target, index);}else{printf("%d not found\n", target);}return0;}