C Programming Questions: Trivia Quiz! Exam

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By SPACECOMPUTER
S
SPACECOMPUTER
Community Contributor
Quizzes Created: 10 | Total Attempts: 49,136
Questions: 40 | Attempts: 1,426

SettingsSettingsSettings
C Programming Questions: Trivia Quiz! Exam - Quiz


Do you think you are an expert with C Programming Language? This quiz highlights specific pertinent questions such as the maximum value of an integer constant when C Language was created, what is permitted in C arithmetic instruction, and a collection of data items called elements. C language is basic, yet it can be challenging to learn. This quiz is the ultimate test on C Programming.


Questions and Answers
  • 1. 

    The Expression, A=30*1000+2768 evaluates to ________________.

    • A.

      -32768

    • B.

      32768

    Correct Answer
    A. -32768
    Explanation
    The given expression, A=30*1000+2768, can be simplified by first multiplying 30 and 1000, which equals 30000. Then, adding 2768 to 30000 gives us a final value of 32768. Therefore, the correct answer is 32768.

    Rate this question:

  • 2. 

    The maximum value that an integer constant can have is ____________________.

    • A.

      -3276700%

    • B.

      3276700%

    Correct Answer
    B. 3276700%
    Explanation
    The maximum value that an integer constant can have is 3276700%.

    Rate this question:

  • 3. 

    C Language came into existence in the year ____________________. 

    • A.

      1971

    • B.

      1972

    Correct Answer
    B. 1972
    Explanation
    C Language came into existence in the year 1972.

    Rate this question:

  • 4. 

    Macros are defined using ___________________ statement.

    • A.

      #define

    • B.

      #include

    Correct Answer
    A. #define
    Explanation
    Macros are defined using the "#define" statement. This statement is used in programming languages like C and C++ to define macros, which are essentially preprocessor directives that allow for the definition of constants or functions. The "#define" statement is followed by the name of the macro and its corresponding value or code. This allows for the easy substitution of the macro with its defined value throughout the code, providing a convenient way to simplify and reuse code.

    Rate this question:

  • 5. 

     ____________________ of the following is allowed in a C arithmetic instruction.

    • A.

      ()

    • B.

      []

    Correct Answer
    A. ()
    Explanation
    In a C arithmetic instruction, using parentheses () is allowed. Parentheses are used to group sub-expressions and control the order of evaluation in an expression. They are used to override the default precedence of operators and ensure that certain operations are performed before others. By using parentheses, the programmer can make the expression clearer and avoid any ambiguity in the calculation.

    Rate this question:

  • 6. 

    The Maximum width of a C variable name can be ________________.

    • A.

      20 Character

    • B.

      32 Character

    Correct Answer
    B. 32 Character
    Explanation
    The maximum width of a C variable name can be 32 characters.

    Rate this question:

  • 7. 

     ________________ are the ASCII values for number 0-9.

    • A.

      23-45

    • B.

      48-57

    Correct Answer
    B. 48-57
    Explanation
    The ASCII values for numbers 0-9 range from 48 to 57.

    Rate this question:

  • 8. 

     In the C Language ‘A’ represents ________________.

    • A.

      A Digit

    • B.

      A Character

    Correct Answer
    B. A Character
    Explanation
    In the C Language, 'A' represents a character. In C, characters are enclosed in single quotation marks, and 'A' is a specific character representation. Characters in C can represent letters, digits, or special symbols, and 'A' specifically represents the uppercase letter A.

    Rate this question:

  • 9. 

    To find factorial of A by using while loop,  A will be ________________.

    • A.

      A

    • B.

      A>0

    Correct Answer
    B. A>0
    Explanation
    In order to find the factorial of A using a while loop, the condition in the while loop should be A>0. This means that the loop will continue executing as long as A is greater than 0. This is necessary because the factorial of a number is calculated by multiplying all the numbers from 1 to that number, and the loop needs to continue until it reaches 1.

    Rate this question:

  • 10. 

    The goto statement causes control to go to ___________________.

    • A.

      An operator

    • B.

      A label

    Correct Answer
    B. A label
    Explanation
    The goto statement causes control to go to a specific location in the code, which is identified by a label. This allows the program to jump to a different part of the code and continue execution from there. The label serves as a marker or identifier for the location where the control should be transferred to.

    Rate this question:

  • 11. 

    The Symbol && is read as ____________________.

    • A.

      AND

    • B.

      OR

    Correct Answer
    B. OR
    Explanation
    The symbol && is commonly read as "AND" in programming languages, but in this case, the correct answer is "OR". This may be because the question is referring to a specific programming language or context where the symbol && is used to represent the logical OR operator.

    Rate this question:

  • 12. 

    An ___________________ is a collection of data items its called elements.

    • A.

      Array

    • B.

      Structure

    Correct Answer
    A. Array
    Explanation
    An array is a collection of data items called elements. Arrays are used to store multiple values of the same data type in contiguous memory locations. Each element in an array can be accessed using its index value, which represents its position in the array. Arrays provide a convenient way to store and manipulate large amounts of data efficiently.

    Rate this question:

  • 13. 

     ___________________ does not represent a valid storage class in “C”.

    • A.

      Automatic

    • B.

      Union

    Correct Answer
    B. Union
    Explanation
    In the C programming language, "union" does not represent a valid storage class. The storage classes in C are "auto", "register", "static", and "extern". "Union" is not a storage class, but rather a data structure that allows different data types to be stored in the same memory location. Therefore, "union" is not a valid answer for this question.

    Rate this question:

  • 14. 

     In ‘C’ logical AND operator is represented as ___________________.

    • A.

      Binary

    • B.

      DOS

    Correct Answer
    A. Binary
    Explanation
    In the programming language 'C', the logical AND operator is represented as "Binary". This means that when using the logical AND operator in 'C', it performs a binary operation on two operands. The operator returns true if both operands are true, otherwise it returns false.

    Rate this question:

  • 15. 

    ___________________ keyword is used to exit loops at arbitrary spots.

    • A.

      Break

    • B.

      CLOSE

    Correct Answer
    A. Break
    Explanation
    The keyword "break" is used to exit loops at arbitrary spots. It is commonly used in programming languages like C, C++, and Java. When the "break" statement is encountered within a loop, the loop is immediately terminated and the program execution continues to the next statement after the loop. This allows for more control and flexibility in loop execution, as it allows programmers to exit the loop based on certain conditions or events.

    Rate this question:

  • 16. 

    The ___________________ loop executes at least once.

    • A.

      Break

    • B.

      Stop

    Correct Answer
    A. Break
    Explanation
    The "Break" loop executes at least once because it is designed to break out of a loop or terminate the loop prematurely.

    Rate this question:

  • 17. 

    In face “++” has a higher precendence than “*”.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false because in mathematics, the operator "*" (multiplication) has a higher precedence than the operator "++" (increment). This means that when evaluating an expression, any multiplication operation will be performed before any increment operation.

    Rate this question:

  • 18. 

    Null will be defined as something else.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement "Null will be defined as something else" is false. In programming, null is a special value that represents the absence of a value or a null reference. It is not defined as something else.

    Rate this question:

  • 19. 

    Scanf function is used to display information on the Monitor.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement is incorrect. The scanf function is not used to display information on the monitor. Instead, it is used to read input from the user. The printf function is used to display information on the monitor.

    Rate this question:

  • 20. 

    A for loop is used to execute a section of code a specific number of times.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A for loop is a control structure in programming that allows a section of code to be executed repeatedly for a specific number of times. It consists of an initialization statement, a condition statement, an increment statement, and the code block to be executed. The loop continues until the condition statement evaluates to false. Therefore, the given statement is true, as a for loop is indeed used to execute a section of code a specific number of times.

    Rate this question:

  • 21. 

    A do while loop is very similar to a while loop.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A do while loop is indeed very similar to a while loop. Both loops are used for repetitive execution of a block of code based on a condition. The main difference is that in a do while loop, the block of code is executed at least once before checking the condition. After the first execution, the condition is checked, and if it is true, the loop continues. If the condition is false, the loop is terminated. This behavior makes the do while loop suitable for situations where the block of code needs to be executed at least once, regardless of the condition.

    Rate this question:

  • 22. 

    The break key word allows you to jump out of any loop at any time.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The break keyword is used in programming to exit or terminate a loop prematurely. When the break keyword is encountered within a loop, it immediately terminates the loop and program execution continues with the next statement after the loop. Therefore, it allows you to jump out of any loop at any time. So, the given statement is true.

    Rate this question:

  • 23. 

    The continue keyword is used in loops to skip right to the test condition.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The continue keyword is used in loops to skip the current iteration and move directly to the next iteration, without executing any further code within the loop for that iteration. This allows the loop to skip certain iterations based on a specific condition, and continue with the next iteration. Therefore, the statement "The continue keyword is used in loops to skip right to the test condition" is true.

    Rate this question:

  • 24. 

     The Return Statement is optional.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The return statement is optional in programming languages. This means that it is not always necessary to include a return statement in a function or method. If a return statement is not included, the function will still execute and perform any other actions or calculations specified within it, but it will not return a value. Including a return statement allows the function to return a specific value or result back to the caller. However, if a return statement is not needed or desired, it can be omitted.

    Rate this question:

  • 25. 

    In C all function except main() can be called recursively.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    In C, all functions can be called recursively, not just main(). Recursion is a programming technique where a function calls itself. This allows for solving complex problems by breaking them down into smaller, more manageable subproblems. Therefore, the correct answer is False.

    Rate this question:

  • 26. 

     In function two return statement should never occur.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false because in a function, it is possible to have multiple return statements. The return statement is used to end the execution of a function and return a value. Depending on the logic and requirements of the function, there may be multiple points where a return statement is needed. So, it is not true that return statements should never occur in a function.

    Rate this question:

  • 27. 

     C program is developed with the help of C++ language.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement is false because C and C++ are two separate programming languages. While C++ is an extension of the C language and includes all of its features, C programs cannot be developed with the help of C++ language. C and C++ have different syntax and features, and although C++ can incorporate C code, they are not interchangeable.

    Rate this question:

  • 28. 

    If Else statement is used when both the statements are False.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement "If Else statement is used when both the statements are False" is incorrect. The If Else statement is used when there is a condition that can be either true or false. If the condition is true, the code inside the If block is executed, otherwise, the code inside the Else block is executed. Therefore, the correct answer is False.

    Rate this question:

  • 29. 

    “C” language has been developed by “Dennis Ritchie”.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement is true because the C language was indeed developed by Dennis Ritchie. He created it in the early 1970s at Bell Labs. C language is a general-purpose programming language that has been widely used for developing various applications and operating systems. Its simplicity and efficiency have made it popular among programmers.

    Rate this question:

  • 30. 

    The maximum width of a “C” variable name can be 10 character.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement is false because the maximum width of a "C" variable name is not limited to 10 characters. In the C programming language, variable names can be up to 31 characters long, consisting of letters, digits, and underscores. The only restriction is that the first character must be a letter or an underscore. Therefore, the statement is incorrect.

    Rate this question:

  • 31. 

    “C” is a low level language.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement "C is a low level language" is false. C is actually considered a high-level programming language. It provides a level of abstraction from the underlying hardware and allows for more efficient and portable programming compared to low-level languages like assembly language.

    Rate this question:

  • 32. 

    Do while loop tests the condition at the End of the Loop.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement is false. In a do-while loop, the condition is tested at the end of the loop. This means that the loop will always execute at least once, regardless of the condition being true or false.

    Rate this question:

  • 33. 

    A flowchart is graphical representation of an algorithm.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    A flowchart is a visual representation that depicts the steps or actions involved in an algorithm. It uses different shapes and symbols to represent various operations, decisions, and inputs/outputs. By using flowcharts, complex processes or algorithms can be simplified and easily understood. Therefore, the statement "A flowchart is a graphical representation of an algorithm" is true.

    Rate this question:

  • 34. 

    An algorithm consists of a set of explicit and unambiguous finite steps.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    An algorithm is a precise set of instructions or steps that are followed to solve a problem or complete a task. These steps must be clear, specific, and limited in number, meaning that they are finite. Additionally, the instructions must be unambiguous, meaning that there is no room for interpretation or confusion. Therefore, the statement "An algorithm consists of a set of explicit and unambiguous finite steps" is true, as it accurately describes the characteristics of an algorithm.

    Rate this question:

  • 35. 

    The C programming language was developed by Charles Babbage.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The given statement is false. The C programming language was not developed by Charles Babbage. It was actually developed by Dennis Ritchie at Bell Labs in the early 1970s. Charles Babbage is known as the "father of the computer" for his work on the Analytical Engine, but he did not develop the C programming language.

    Rate this question:

  • 36. 

    The C complier runs a program called the C Processor.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The C compiler is responsible for translating the C code into machine-readable instructions. It takes the source code as input and processes it to generate an executable program. The compiler performs various tasks such as lexical analysis, syntax analysis, semantic analysis, and code generation. The C Processor mentioned in the question is likely referring to the compiler itself, as it is the program that processes the C code. Therefore, the statement "The C compiler runs a program called the C Processor" is true.

    Rate this question:

  • 37. 

    Strcpy is used to copy the string.

    • A.

      True

    • B.

      False

    Correct Answer
    A. True
    Explanation
    The statement is true because strcpy is indeed a function in C/C++ that is used to copy one string to another. It takes two arguments - the destination string where the copied string will be stored, and the source string which will be copied. This function is commonly used when we want to duplicate or manipulate strings in programming.

    Rate this question:

  • 38. 

    Pointer is mainly used Point out the Function.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    Pointers in programming languages are primarily used to store memory addresses and manipulate data indirectly. They are not specifically used to point out functions. Functions can be called directly without the need for pointers. Therefore, the given statement is false.

    Rate this question:

  • 39. 

    A Header File is a file that contains Definitions and Macros.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    A header file is a file that contains declarations and definitions of functions, variables, and other objects that can be used in a program. It typically includes function prototypes, type definitions, and macro definitions, but does not contain actual implementations or executable code. Therefore, a header file does not contain definitions and macros, but rather declarations and other necessary information for using them. Hence, the given statement is false.

    Rate this question:

  • 40. 

    A link is a Complier.

    • A.

      True

    • B.

      False

    Correct Answer
    B. False
    Explanation
    The statement "A link is a Compiler" is false. A link refers to the process of combining multiple object files to create an executable file. It is a separate step in the compilation process. On the other hand, a compiler is a software program that translates source code into object code or machine code. While a link is a part of the overall compilation process, it is not the same as a compiler.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 21, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • May 31, 2012
    Quiz Created by
    SPACECOMPUTER
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.