#include<stdio.h> void equal(int a[],int N) { int i; for(i=0;i<N;i++) { if(i<a[i]) { printf("no exist "); printf("%d ",i); break; } if(i==a[i]) printf("equal %d ",i); } } int main() { int arr[10]={-5,-1,1,5,7,8,9,10,11,12}; equal(arr,10); }
#include<stdio.h> void equal(int a[],int N) { int i; for(i=0;i<N;i++) { if(i<a[i]) { printf("no exist "); printf("%d ",i); break; } if(i==a[i]) printf("equal %d ",i); } } int main() { int arr[10]={-5,-1,1,5,7,8,9,10,11,12}; equal(arr,10); }