fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int arr[]={10,20,20,10,10,30,50,10,20};
  6. //printf("%d",sizeof(arr));
  7. int i=0,j=1;
  8. int flag=0;
  9. while(arr[i]==arr[j])
  10. {
  11. j++;
  12. flag++;
  13. }
  14.  
  15.  
  16. printf("%d",flag);
  17. return 0;
  18. }
  19.  
Success #stdin #stdout 0s 9424KB
stdin
Standard input is empty
stdout
Standard output is empty