--:--









Quiz for Single-dimensional arrays

Course: C Language | Subject: Unit 5 | Topic: Arrays and Strings



Logo

Q1: Which of the following correctly declares a single-dimensional array of integers in C?

Logo

Q2: What is the index range of an array declared as int arr[5];?

Logo

Q3: Which of the following accesses the third element of array arr?

Logo

Q4: If int arr[5] = {1,2,3}; is declared, what are the remaining elements initialized to?

Logo

Q5: Which operator is used to access array elements?

Logo

Q6: What is the output of printf("%d", arr[0]); if int arr[3]={5,10,15};?

Logo

Q7: What will happen if you try to access arr[10] when arr is declared as int arr[5];?

Logo

Q8: Which of these correctly initializes all elements of an array to zero?

Logo

Q9: Array elements are stored in which order in memory?

Logo

Q10: Which keyword is NOT used when declaring a normal array in C?

Logo

Q11: If int arr[5]={1}; is declared, arr[1] will be?

Logo

Q12: Which of the following is NOT valid?

Logo

Q13: Which of the following correctly calculates the size of an array in bytes?

Logo

Q14: Which of these can be used to determine the number of elements in an array arr?

Logo

Q15: Which of these is valid array initialization?

Logo

Q16: In C, what is the default initial value of local array elements without explicit initialization?

Logo

Q17: If int arr[5]; is declared globally, what will be the default values?

Logo

Q18: Which of these is the correct way to pass an array to a function?

Logo

Q19: Which statement is true about array name in C?

Logo

Q20: What will printf("%d", 2[arr]); output if arr[]={10,20,30};?

Are you ready to start test? Set your time limit