Recently I encountered this puzzle :
int main(){
int arr[7];
int b,c,d,a;
a=4;
printf("%d",arr[?]);
return 0;
}
The question is to Replace "?" with a integer so that output is 4. I am not sure but I don't think this is solvable in a standard way ?! (Not invoking Undefined Behavior or depending on implementation) If NO, then I am very interested in knowing how ?
Edit:This task is taken from here, I tried to solve with 10, but sadly it's not the answer the problem setter wants.However, I solved it using some pretested implementation dependent mumbo-jumbo,but I really have no explanation for how it really works!
Here is the answer : SPOILER,You are welcome to explain it
When we recently wrote about the toughest math problems that have been solved, we mentioned one of the greatest achievements in 20th-century math: the solution to Fermat's Last Theorem. Sir Andrew Wiles solved it using Elliptic Curves.
Google Lens can solve simple equations such as “5+2” or more complex formulas such as “x2 – 3x + 2.” You can scan the problem from a real-world piece of paper or from a digital display. Open the “Google” app on your Android phone or tablet, iPhone, or iPad.
Math alone cannot solve deeply-rooted societal problems, and attempting to rely on it will only reinforce inequalities that already exist in the system.
In most implementations, arr[10]
(or 7) will be 4, since the locals will be laid out sequentially.
However, this is neither defined nor standard, and must not be relied on.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With