#include <stdio.h>
#define MAX 1000000000
int main() {
int n;
int a[n],i=0,j=0;
for(;i<n;i++)
int min_index=-1,current_min=-1;
for(j=1;j<=3;j++){ // find minimum 3 times
current_min = a[0]; // stores minimum
min_index=0; // stores index of the minimum
for(i=0;i<n;i++){ // iterate through the entire array and find the minimum
if(a[i]<current_min)
{
current_min=a[i];
min_index = i;
}
}
a[min_index]=MAX; // replace the current minimum with some high value so that it doesnt interfere while finding the minimum in the next iteration
}
printf("Value = %d\nPosition = %d\n", current_min
,min_index
+1); // added 1 due to 0 incexing in array
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNkZWZpbmUgTUFYIDEwMDAwMDAwMDAKCmludCBtYWluKCkgewppbnQgbjsKc2NhbmYoIiVkIiwmbik7Ly8gbj49MwppbnQgYVtuXSxpPTAsaj0wOwoKZm9yKDtpPG47aSsrKQpzY2FuZigiJWQiLCZhW2ldKTsKCmludCBtaW5faW5kZXg9LTEsY3VycmVudF9taW49LTE7Cgpmb3Ioaj0xO2o8PTM7aisrKXsgLy8gZmluZCBtaW5pbXVtIDMgdGltZXMKY3VycmVudF9taW4gPSBhWzBdOyAvLyBzdG9yZXMgbWluaW11bSAKbWluX2luZGV4PTA7ICAvLyBzdG9yZXMgaW5kZXggb2YgdGhlIG1pbmltdW0KCmZvcihpPTA7aTxuO2krKyl7IC8vIGl0ZXJhdGUgdGhyb3VnaCB0aGUgZW50aXJlIGFycmF5IGFuZCBmaW5kIHRoZSBtaW5pbXVtCmlmKGFbaV08Y3VycmVudF9taW4pCnsKICAgIGN1cnJlbnRfbWluPWFbaV07CiAgICBtaW5faW5kZXggPSBpOwp9Cn0KIGFbbWluX2luZGV4XT1NQVg7IC8vIHJlcGxhY2UgdGhlIGN1cnJlbnQgbWluaW11bSB3aXRoIHNvbWUgaGlnaCB2YWx1ZSBzbyB0aGF0IGl0IGRvZXNudCBpbnRlcmZlcmUgd2hpbGUgZmluZGluZyB0aGUgbWluaW11bSBpbiB0aGUgbmV4dCBpdGVyYXRpb24KfQoKcHJpbnRmKCJWYWx1ZSA9ICVkXG5Qb3NpdGlvbiA9ICVkXG4iLCBjdXJyZW50X21pbixtaW5faW5kZXgrMSk7IC8vIGFkZGVkIDEgZHVlIHRvIDAgaW5jZXhpbmcgaW4gYXJyYXkKCnJldHVybiAwOwp9Cg==