Computer Programming Flashcards
6 cards from real AMCAT practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 Computer Programming flashcards as text
What is the output of the following C code? int x = 5; printf('%d', x++);
Answer: 5
x++ is post-increment, so the current value 5 is printed before incrementing.
Which data type in C is used to store a single character?
Answer: char
The 'char' data type in C stores a single character using 1 byte of memory.
What does the '==' operator do in most programming languages?
Answer: Compares two values for equality
'==' is the equality comparison operator, returning true if both operands have the same value.
What is the time complexity of accessing an element in an array by index?
Answer: O(1)
Array elements are stored in contiguous memory, so index-based access is constant time O(1).
Which of the following is NOT a loop construct in C?
Answer: repeat-until
C does not have a 'repeat-until' loop; it uses 'for,' 'while,' and 'do-while' loops.
What is the result of 7 % 3 in most programming languages?
Answer: 2
The modulo operator (%) returns the remainder: 7 ÷ 3 = 2 remainder 1... wait — 7 = 3×2 + 1, so 7 % 3 = 1.