Podcast
Questions and Answers
Which of the following is NOT a valid string in C?
Which of the following is NOT a valid string in C?
- "Hello, world!"
- 'C programming'
- ""
- 12345 (correct)
What is the maximum length of a string in C?
What is the maximum length of a string in C?
- 1024 characters
- 255 characters
- There is no maximum length (correct)
- 512 characters
Which function can be used to concatenate two strings in C?
Which function can be used to concatenate two strings in C?
- strncpy()
- strncat()
- strcat() (correct)
- strcpy()
Which of the following is a valid way to declare a string in C?
Which of the following is a valid way to declare a string in C?
What is the result of the following code snippet?
char s[] = 'hello';
printf('%c', s[5]);
What is the result of the following code snippet? char s[] = 'hello'; printf('%c', s[5]);
Which of the following functions can be used to compare two strings in C?
Which of the following functions can be used to compare two strings in C?
Which of the following is the correct way to declare a 2D array in C?
Which of the following is the correct way to declare a 2D array in C?
What is the correct way to access an element in a 2D array in C?
What is the correct way to access an element in a 2D array in C?
What is the size of a 2D array declared as int arr[3][4]; in C?
What is the size of a 2D array declared as int arr[3][4]; in C?
Flashcards are hidden until you start studying