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

Quiz

quizz 3 harith

Harith Lakmith 17 Fragen

Quiz starten

Fragen in diesem Quiz (17)

  1. 1What is the final value of x when the code int x; for(x=0; x<10; x++) {} is run?
    1. A10
    2. B9
    3. C0
    4. D1
  2. 2int main ()

    {

    int x = 20, y = 35;

    x = y++ + x++;

    y = ++y + ++x;

    printf ("%d %d n", x, y);

    }
    1. A55 92
    2. B56 93
    3. C57 94
    4. Dnone
  3. 3#include <stdio.h>

    int main()
    {
    int i = 1024;
    for (; i; i >>= 1)
    printf("GeeksQuiz");
    return 0;
    }


    How many times will GeeksQuiz be printed in the above program?
    1. A10
    2. B11
    3. Cinfinity
    4. Derror
  4. 4#include<stdio.h>
    int main()
    {
    int n;
    for (n = 9; n!=0; n--)
    printf("n = %d", n--);
    return 0;
    }

    What is the output
    1. A9 7 5 3 1
    2. B9 8 7 6 5 4 3 2 1
    3. Cinfinity
    4. D9 7 5 3
  5. 5Output?
    #include <stdio.h>
    int main()
    {
    int c = 5, no = 10;
    do {
    no /= c;
    } while(c--);

    printf ("%dn", no);
    return 0;
    }
    1. A1
    2. Bruntime error
    3. C0
    4. Dcompile error
  6. 6# include <stdio.h>
    int main()
    {
    int i = 0;
    for (i=0; i<20; i++)
    {
    switch(i)
    {
    case 0:
    i += 5;
    case 1:
    i += 2;
    case 5:
    i += 5;
    default:
    i += 4;
    break;
    }
    printf("%d ", i);
    }
    return 0;
    }
    1. A5 10 15 20
    2. B7 12 17 22
    3. C16 21
    4. Dcompile error
  7. 7#include <stdio.h>
    int main()
    {
    int i = 3;
    switch(i)
    {
    printf("Outside ");
    case 1: printf("Geeks");
    break;
    case 2: printf("Quiz");
    break;
    defau1t: printf("GeeksQuiz");
    }
    return 0;
    }
    1. AOutside GeeksQuiz
    2. BGeeksQuiz
    3. CNothing gets printed
  8. 8How many times GeeksQuiz is printed
    #include<stdio.h>
    int main()
    {
    int i = -5;
    while (i <= 5)
    {
    if (i >= 0)
    break;
    else
    {
    i++;
    continue;
    }
    printf("GeeksQuiz");
    }
    return 0;
    }
    1. A10
    2. B5
    3. Cinfinity
    4. D0
  9. 9#include <stdio.h>
    int main()
    {
    int i = 3;
    while (i--)
    {
    int i = 100;
    i--;
    printf("%d ", i);
    }
    return 0;
    }
    1. Ainfinity loop
    2. B99 99 99
    3. C99 98 97
    4. D2 2 2
  10. 10#include <stdio.h>
    int main()
    {
    int x = 3;
    if (x == 2); x = 0;
    if (x == 3) x++;
    else x += 2;

    printf("x = %d", x);

    return 0;
    }
    1. Ax=4
    2. Bx=2
    3. Ccomplile error
    4. Dx=0

Informationen

Beschreibung
Quiz am quizz 3 harith, erstellt von Harith Lakmith am 22/08/2018.
Sprache
English
Aufrufe
165
Bewertung
Noch keine Bewertungen
Bewerte dieses Quiz
Bewerte dieses Quiz

Mehr zu Conditionals and Loops

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck