Pre-CA4

Pre-CA4

University

7 Qs

quiz-placeholder

Similar activities

C-Basic

C-Basic

University

10 Qs

Quiz 1 - Intro to C

Quiz 1 - Intro to C

University

10 Qs

Basic C Knowledge Exercise

Basic C Knowledge Exercise

University

10 Qs

Quiz 2

Quiz 2

University

12 Qs

unidad4

unidad4

University

10 Qs

POP QUIZ !

POP QUIZ !

University

8 Qs

javaquizvivek

javaquizvivek

University

12 Qs

PYTHON DAY 2

PYTHON DAY 2

University

12 Qs

Pre-CA4

Pre-CA4

Assessment

Quiz

Computers

University

Hard

Created by

Noob Code

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is true ?

gets() can read a string with newline characters but a normal scanf() with %s can not.

gets() can read a string with spaces but a normal scanf() with %s can not.

gets() can always replace scanf() without any additional code.

None of the Them.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

int main()

{

    int i = 3;

    printf("%d", (++i)++);

    return 0;

}

What is the output of the above program?

3

4

5

Compile-time error.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Predict the output .

#include <stdio.h>

 

int main()

{

   float c = 5.0;

   printf ("Temperature in Fahrenheit is %.2f", (9/5)*c + 32);

   return 0;

}

Temperature in Fahrenheit is 41.00

Temperature in Fahrenheit is 37.00

Temperature in Fahrenheit is 0.00

Compiler Error.

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the below program?

#include <stdio.h>

int main()

{

    int i = 0;

    switch (i)

    {

        case '0': printf("Geeks");

                break;

        case '1': printf("Quiz");

                break;

        default: printf("GeeksQuiz");

    }

    return 0;

}

Geeks

Quiz

GeeksQuiz

Compile-time error.

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

#include <stdio.h>

#define a 10

int main()

{

  printf("%d ",a);

 

  #define a 50

 

  printf("%d ",a);

  return 0;

}

Output ?

Compiler Error

10 50

50 50

10 10

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Predict output of following program

#include <stdio.h>

int main()

{

    int i;

    int arr[5] = {1};

    for (i = 0; i < 5; i++)

        printf("%d ", arr[i]);

    return 0;

}

1 followed by four garbage values

1 0 0 0 0

1 1 1 1 1

0 0 0 0 0

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

# include <stdio.h>

 

int main()

{

   char str1[] = "GeeksQuiz";

   char str2[] = {'G', 'e', 'e', 'k', 's', 'Q', 'u', 'i', 'z'};

   int n1 = sizeof(str1)/sizeof(str1[0]);

   int n2 = sizeof(str2)/sizeof(str2[0]);

   printf("n1 = %d, n2 = %d", n1, n2);

   return 0;

}

What is the output of following program?

n1 = 10, n2 = 9

n1 = 10, n2 = 10

n1 = 9, n2 = 9

n1 = 9, n2 = 10