What will be the output of the following C code? #...
Guiding State PSC aspirants since 2016 50,000+ students · 1,000+ final selections Exam Calendar Results Call 9116926003
pscnotes
Pick your state
APPSC Prelims previous year questions

What will be the output of the following C code? #include <stdio.h> int main() { int arr[] = {1, 2, 3, 4, 5, 6}; int i; int key = 5; int size = 6; for (i = 0; i < size; i++) { if (arr[i] == key) { printf("Element found at position: %d", i); break; } } return 0; } Choose the correct option.

Asked in APPSC (Arunachal) Question Booklet (Set-A) of Paper I and Paper II 2026

  1. Element found at position : 6
  2. Element found at position : 5
  3. Element found at position : 4
  4. Element found at position : 3
Show answer

Answer: C. Element found at position : 4

More APPSC Prelims previous year questions questions

All 7,479 APPSC Prelims previous year questions questions →