Register New Player - Log In
Welcome to our world of fun trivia quizzes and quiz games:     New Player quiz register Play Now! trivia game

Beginning C Programming

Created by mike32768

Fun Trivia : Quizzes : Software and Programming
Beginning C Programming game quiz
"The C language has been around since 1972 and remains a favorite of programmers. It combines the convenience of a high-level language with the power of a low-level language. It is not without its oddities; some of which we will consider here."

15 Points Per Correct Answer - No time limit  



1. Who are the writers of the classic manual, "The C Programming Language"?
    Carnigan & Ricky
    Corrigan & Richards
    Kernighan & Ritchie
    Kerrigan & Richmond


2. In general (other than within string constants like "Hello World" and a few obscure constructs), what effect does the amount of whitespace (spaces and tabs) between code elements have on a C program's compiled output?
    Spaces are ignored, tabs have meaning.
    Spaces and tabs both have meaning.
    Tabs are ignored, spaces have meaning.
    Spaces and tabs are both ignored.


3. Why are line numbers used when writing C source code?
    They aren't used.
    To maintain order of the lines at compile time.
    To indicate the start of a new line.
    To make the code easier to read.


4. How does one indicate that certain text is to be treated as a "comment" in the classic C language?
    Place the text between /* */ .
    Place 'COMMENT:' before the text.
    Place '#' before the text.
    Place the text between # and #.


5. What will this piece (snippet) of C code print to the screen?

printf("Hello World");
/* This is a comment
printf("Hello Again");
This is another comment */
    Both "Hello World" and "Hello Again".
    Only "Hello World".
    Only "Hello Again".
    Neither.


6. Is there a difference between i++ and ++i ?
    No difference.
    Sometimes there's a difference, sometimes not.
    ++i is illegal.
    i++ is illegal.


7. Say you had a piece (snippet) of C code that looked like this:

if( i > 0 )
j = 5;

with both the if statement and the assignment on the same line. Now suppose that you insert a hard return (enter) right before "j=5;". What will change in the behavior of the code?
    The original is illegal.
    Both versions are illegal.
    The modification is illegal.
    Nothing, and both versions are legal.


8. In C programming, what does i equal at the end of the following piece (snippet) of code?

i = 1;
i *= 5;
i += 3;
    5
    3
    1
    8


9. In the C language, how does one write the statement, "if i NOT equal to zero"?
    if ( i != 0 )
    if ( i NOT= 0 )
    if ( i == 0 )
    if ( i = !0 )


10. When programming in C, what will j equal at the end of the following piece (snippet) of code?

i = 1;
j = 0;
if( i = 1 ) j = 3;
if( i = 2 ) j = 5;
    None of these
    0
    5
    3


Copyright, FunTrivia.com. All Rights Reserved.
Legal / Conditions of Use
Compiled Jun 19 13