Oh BoI 2

A computer programmer working with C code on a screen, surrounded by mathematical symbols and regular expression patterns, with a focus on learning and problem-solving.

Mastering C and Regular Expressions Quiz

Put your knowledge to the test with our engaging quiz designed for programmers and tech enthusiasts. This quiz focuses on C programming concepts, arrays, variables, and regular expressions. Challenge yourself and see how well you grasp these fundamental topics!

  • 10 challenging questions
  • Multiple choice format
  • Test your understanding of C and regular expressions
10 Questions2 MinutesCreated by CodingGuru912
To match an element not less than 2 times and no more than 5 times, the regular expression will contain:
{2-5}
{2,5}
(2..5)
[2-5]
To match all incrementations with ++ and decrementations with – of two-letter variables. E.g. ++ v1, v++, --v, assuming that any valid identifiers might be used and between symbols any number of spaces might be inserted, which could use the regular expression:
[+-]{2} [[:alpha:]_][[:alnum:]]|[[:alpha:]_][[:alnum:]][+-]{2}
[+-]{2} *[[:alpha:]_][[:alnum:]][[:alpha:]_][[:alnum:]] *[+-]{2}
[[:alpha:]_][[:alnum:]]|[[:alpha:]_][[:alnum:]] *
[+-]{2} *[[:alpha:]_][[:alnum:]]|[[:alpha:]_][[:alnum:]] *[+-]{2}
To match all function declarations with the format void *fun(void *par);, assuming that inserting any valid identifiers might be used and between symbols any number of spaces might be inserted, we could use the regular expression:
Void *[[:alpha:]_][[:alnum:]] + ( void *[[:alpha:]_][[:alnum:]]+);
Void *\* *[[:alpha:]_][[:alnum:]]* *\( *void *\*[[:alnum:]][[:alpha:]]*
Void *\* *[[:alpha:]_][[:alnum:]]* *\( *void *\*[[:alpha:]_][[:alnum]]* *\)
Void *\* *[[:alpha:]][[:alnum:] ]* *\( *void *\*[[:alpha:]][[:alnum:]]*
Arrays in bash DO NOT have the property
Any reference to an array variable without a subscript refers to element zero of it
Multi-dimensional arrays are not supported
The expression ${#people(1)} yields the size of element number on in the people array
Array elements occupy cells numbered with consecutive non-negative integer indexes
Arrays in bash DO NOT have the property
Associative arrays may be referenced using arbitrary strings for indices, not only integers
By using the += assignment operator, we can automatically append values to an array
The expression $(#people[0]) yields the number of elements in the people array
Allowed array element types are: char, int, float, double and pointers
Other
Please Specify:
Variables in C DO NOT have the property:
A type of a variable does not affect the size of memory required to hold it, but determines which operations are permitted
Global variables are also called static as they are created when a program is loaded into memory and exist until it terminates
The stack segment is used to hold local variables
Variables may be referenced by name and indirectly, I.e. By pointers
Variables in C DO NOT have the property:
A type of a variable is established in declaration and will never change
Local variables are also called automatic as they are created automatically when the control enters -their scope and are destroyed when the control leaves their scope
The stack segment is used to hold global variables
Variables may be referenced by name and indirectly, I.e. By pointers
Arrays in C DO NOT have the property:
Each array element may be accessed individually by specifying array name together with an index in square bracket
Arrays have a hidden property that informs about its length and may be used to validate indices
Array name is treated as the pointer to its initial element
A typical array declaration includes its element type, an array name and a number of elements in square brackets
Arrays in C DO NOT have the property:
An array may be assigned as a whole to another array by using the standard assignment operator, which makes element-by-element assignment
Arrays can be sent to functions as arguments
Array name is treated as the pointer to its initial element
A typical array declaration includes its element type, an array name and a number of elements in square breackets
Structures in C DO NOT have the property:
A structure may be assigned as a whole to another structure by using the standard assignment operator, which makes field-by-field assignment
Structures may be sent as arguments to functions and returned from them, although using pointers to structures may be more effective
Structures may be compared by using standard equality operators == and !=
To initialize a structure with designators one does not need to supply the values of all the fields in order of their declaration.
{"name":"Oh BoI 2", "url":"https://www.quiz-maker.com/QPREVIEW","txt":"Put your knowledge to the test with our engaging quiz designed for programmers and tech enthusiasts. This quiz focuses on C programming concepts, arrays, variables, and regular expressions. Challenge yourself and see how well you grasp these fundamental topics!10 challenging questionsMultiple choice formatTest your understanding of C and regular expressions","img":"https:/images/course2.png"}
Powered by: Quiz Maker