i have written this code to print the position of max in the array.
but how can i find all the positions of max? (3.5.9).
Code:#include<stdio.h> main() { int array[10]={4,5,6,9,8,9,4,1,2,9}; int max,pos; max=array[0]; for(int i=1;i<10;i++) if(array[i]>max) { max=array[i]; pos=i; } printf("position:%d",pos); }