title: Why would it jump to the `else` part?
body: <p>I just tried to this <code>linear search</code> and it turns out that it displays the <code>else</code> part. And I don't get what I have done wrong. The logic... </p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  main()
  {
        int a[10], i, x, size;
        printf("Enter the size of the array: \n");
        scanf("%d",&amp;size);
        printf("Enter the elements into the array: \n");
        for(i=0; i&lt;size; i++)
        {
                 scanf("%d",&amp;a[i]);
        }
        printf("Enter the element to be searched for: \n");
        scanf("%d",&amp;x);
        for(i=0; i&lt;size; i++)
        {
                 if(x==a[i])
                 {
                     printf("The element is at: %d",i);
                     break;
                 }
                 else
                 {
                     printf("The element is not in the array.");
                     break;
                 }
        }
  getch();
  }
  </code></pre>