GoConqr has a new look! Let us know what you think.

Quiz

FEH C/C++ Quiz

Jared Sherrick 18 questions

Take the quiz

This quiz has question types that open in the usual player.

Questions in this quiz (18)

  1. 1In C/C++, using the printf command to display something to the command terminal is the same as using the fprintf command except the fprintf command has [blank_start]stdout[blank_end] as the first argument.
    1. Astdout
  2. 2Which line of code below will generate a segmentation fault error when it compiles?
    1. Ascanf("format", &var1, &var2);
    2. Bscanf("format", &var1, &var2)
    3. Cscanf("format", var1, var2);
    4. Dscanf("format", var1, var2)
  3. 3When reading a string with scanf, an & is required.
    1. ATrue
    2. BFalse
  4. 4In the following code, which line(s) contains an error?

    1 int main()
    2 {
    3 FILE fptr1;
    4 int memes;
    5 fptr = fopen("Exan.txt","r");
    6 if (*fptr1 != NULL)
    7 {
    8 printf("File opened successfully!\n\n");
    9 }
    10 fscanf (fptr1, "%d", memes);
    1. A3, 6, 10
    2. B3, 10
    3. C3, 6, 8
    4. D8, 10
  5. 5The following loop will stop executing when the end of file condition is detected (assume inptr has been declared as a file pointer already):
    while (!feof(inptr))
    1. ATrue
    2. BFalse
  6. 6[blank_start]&&[blank_end] --- This is the AND operator in C/C++
    [blank_start]||[blank_end] --- This is the OR operator in C/C++
    [blank_start]![blank_end] --- This is the NOT operator in C/C++
    [blank_start]=[blank_end] --- This is the Assignment operator in C/C++
    [blank_start]==[blank_end] --- This is the Equality operator in C/C++
    1. A==
    2. B=
    3. C!
    4. D||
    5. E&&
  7. 7When writing input and output in C++, it is necessary to write std:: before every cin and cout, unless you write [blank_start]using namespace std;[blank_end].
    1. Ausing namespace std;
  8. 8When writing in C++, it is necessary to use this symbol on occasion "::". Its name is the [blank_start]binary scope resolution[blank_end] operator.
    1. Abinary scope resolution
  9. 9<< --- [blank_start]Insertion Operator[blank_end]
    >> --- [blank_start]Extraction Operator[blank_end]
    1. AInsertion Operator
    2. BExtraction Operator
    3. CDouble Arrow Operator
  10. 10Please enter the C++ command to open a file named Santa.txt. Note: assume a file pointer named fin has already been created.

    [blank_start]fin.open(“SANTA.txt");[blank_end]
    1. Afin.open(“Santa.txt");

Information

Description
A quiz for FEH students over C/C++ material.
Language
English
Views
66
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?