GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Quiz

C programming basics: variables, functions, loops

Morten J. 14 Fragen Aktualisiert am 7 Dez 2018

Quiz starten

Fragen in diesem Quiz (14)

  1. 1Declaring variables

    Which of the following statements correctly declare variables?
    1. Aint sum = 5;
    2. Bsum = 7;
    3. Cvoid x = 31;
    4. Ddouble d = 2.5;
  2. 2What is the result of 45 / 4?
    1. A11.25
    2. B12
    3. C10
    4. D11
  3. 3Declaring functions
    Which of the following declare a function that sums two numbers and gives the result to the caller?
    1. Adouble sum(double d1, double d2) { return d1 + d2; }
    2. Bvoid sum(double d1, double d2) { return d1 + d2; }
    3. Cdouble sum(double d1, double d2) { d1 + d2; }
    4. Dvoid sum(double d1, double d2) { sum = d1 + d2; }
  4. 4Character values
    Which of the following is the correct expression of the character 7?
    1. A7
    2. B'7'
    3. C"7"
    4. D<7>
  5. 5Assignment operator
    ________ is the assignment operator.
    1. A=
    2. B:=
    3. C=:
    4. D==
  6. 6Printing characters
    Suppose c is a char variable with the value 'e'. What is the printout of the statement printf("%c", +
    +c)?
    1. Ac
    2. Bd
    3. Ce
    4. Df
  7. 7Compiler checks
    The compiler checks ________.
    1. ASyntax errors
    2. BRunetime errors
    3. CLogical errors
  8. 8Declaring strings
    Which of the following statements correctly declare a C string?
    1. Astring s = "Hello, World!";
    2. Bchar s = "Hello, World";
    3. Cchar s[] = "Hello, World!";
    4. Dstring s = 'Hello, World!';
  9. 9Bits and bytes
    One byte usually has ________ bits.
    1. A4
    2. B8
    3. C12
    4. D16
  10. 10Main function
    Which of the following are valid main functions?
    1. Aint main() { return 0; }
    2. Bvoid main() { }
    3. Cint main() { }
    4. Dvoid main() { return 0; }

Informationen

Beschreibung
Quiz am Ohne Titel, erstellt von Morten J. am 07/12/2018.
Sprache
English
Aufrufe
0
Verlauf
Erstellt am 7 Dez 2018 · aktualisiert am 7 Dez 2018
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Mehr zu C Programming Basics

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck