To Make Logic First We Think That We Have To Traverse Whole Array Form Start To End So we Decide To Use a Loop
First for Loop Taking Input in Array Element By Element Second Displaying Entered Elements
Third for Loop Which is Main For Loop Having an if Condition Which Checks Every Array Element with Key
If an Element Matches With Key if Condition Becomes True and Loop Terminates With Break Statement
Then If Condition Outside Loop Which Will Become True Because Loop Variable 'i' not Equal to Size Of Array
If Element Not Found In Array Than Loop Will Run Complete And If Condition Will Not True Because in This Case Loop Will Run Complete And After Termination Variable 'i' Will be Equal to Size Variable