--:--









Quiz for Declaration & initialization

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



Logo

Q1: Which is the correct way to declare an integer array of size 5 in C?

Logo

Q2: What is the index range for an array of size 10?

Logo

Q3: Which is a valid initialization of an integer array?

Logo

Q4: What happens if fewer values are given than the array size during initialization?

Logo

Q5: Which of the following is NOT a valid array declaration?

Logo

Q6: How can you declare and initialize a string in C?

Logo

Q7: What is the size of char str[] = "Hi";?

Logo

Q8: Which statement is true about array size in C?

Logo

Q9: Which is the correct way to initialize all elements to zero?

Logo

Q10: What will int arr[] = {1,2,3}; set the size to?

Logo

Q11: Which of the following is correct for a float array?

Logo

Q12: In C, uninitialized local arrays contain?

Logo

Q13: Which declaration is valid for a 2D array?

Logo

Q14: What is the output of sizeof(int[10])?

Logo

Q15: Which array declaration is invalid in C?

Logo

Q16: Which syntax declares a constant integer array?

Logo

Q17: What does int arr[3] = {1}; initialize?

Logo

Q18: Which is the correct syntax to declare an array pointer?

Logo

Q19: Which array initialization is valid for a char array?

Logo

Q20: If you omit the size in array declaration, what must be present?

Are you ready to start test? Set your time limit