Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

NEXOVATE_SAMPLE_2

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

1)What is the output of the following code snippet?

    int x = 5;

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

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

    return 0;

a)

5,7


b)

6,7


c)

5,6


d)

None of the above


2.

What is the purpose of the 'sizeof' operator in C?


a)

It returns the size of a variable in bytes

b)

It returns the size of a function in bytes


c)

It returns the size of a datatype in bytes

d)

It returns the size of a string in bytes


3.

Which of the following is NOT a valid variable name in C?

a)

_myVar

b)

123var


c)

var123


d)

my_Var


4.

What is the purpose of the "if" keyword in python programming?

a)

To declare a variable

b)

To define a function

c)

To conditionally execute code


d)

To perform arithmetic operations


5.

Which of the following data structures is typically implemented using a Last-In-First-Out (LIFO) approach?

a)

Queue


b)

Stack


c)

Linked List


d)

Tree


6.

In which sorting algorithm does the swapping of elements occur repeatedly until the array is sorted?

a)

 Merge Sort


b)

Bubble Sort


c)

Quick Sort


d)

Insertion Sort


7.

Which of the following is NOT a fundamental data type in C programming?


a)

int


b)

float


c)

char


d)

string


8.

Which of the following is used to terminate the loop ?

a)

break


b)

return


c)

continue


d)

exit


9.

Which of the following is NOT a valid keyword in C?

a)

main


b)

function

c)

return


d)

break


10.

What is the purpose of the 'continue' statement in a loop?

a)

It skips the current iteration of the loop and continues with the next iteration.

b)

It terminates the loop.

c)

It returns a value from the loop.


d)

It jumps to a specific label within the loop..


11.

What is the output of the following code snippet?

    int x = 10;

    int y = 5;

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

    return 0;

a)

15


b)

16

c)

20

d)

Compilation error


12.

Which of the following languages are case sensitive?

1. c

2. c++

3. java

4. python

  


a)

only 1,2,3

b)

only 2,3,4

c)

only 2,3

d)

1,2,3,4.

13.

public class Main{ 

    public static void main(String[] arr){ 

        int num1 = 500; 

        int num2 = 500; 

        Integer num3 = 500; 

        Integer num4 = 500; 

          

        if(num1==num2){ 

            System.out.print("num1==num2"); 

        } 

        else{ 

            System.out.print("num1!=num2"); 

        } 

System.out.print(" & ");

        if(num3==num4){ 

            System.out.print("num3==num4"); 

        } 

        else{ 

            System.out.print("num3!=num4"); 

        } 

    } 

} 

a)

num1 == num2   &  num3 == num4

b)

num1 == num2   &  num3 != num4


c)

num1 != num2   &  num3 == num4


d)

num1 != num2   &  num3 != num4


14.

public class Main{ 

    public static void main(String[] args) 

    { 

        System.out.println('j' + 'a' + ''v'' + 'a'); 

    } 

}


a)
  1. j312

b)
  1. java

c)
  1. 230va

d)

  1. 418

15.

Which of the following is an exit controlled loop?

a)
  1. While loop

b)
  1. For Loop

c)
  1. Do-While Loop

d)
  1. None Of the Above

16.

Array is a collection of different data type in java?

a)
true
b)
false
17.

Which symbol is used to represent an input/output operations in flowchart ?

a)

circle


b)

parallelogram


c)

oval


d)

rectangle


18.

Which programming language is called as the mother of programming languages?

a)

c++

b)

COBOL


c)

c

d)

python


19.

In c, if size of a character is one byte, then what is the size of the array given below ?

char arr[]="Welcome to Nexovate";

a)

19

b)

17

c)

20

d)

21

20.

what is the size of the array given below ?

float a[5];

a)

4

b)

9

c)

20

d)

5

21.

What type of data structure is used in google maps?

a)

graph


b)

tree

c)

linked list


d)

heap


22.

Which of these is a selection statement?


a)

break


b)

continue


c)

for


d)

if


23.

What is the output ?(easy)

class Output

{

public static void main(string arg[])

{

double x=2.0;

double y=3.0;

Double z=Math.pow(x,y);

System.out.println(z)

}

}

a)

6.0


b)

8.0


c)

3.0


d)

None of the above


24.

Which of the following is not an access modifier?


a)

protected

b)

void


c)

private


d)

public


25.

Which one of the following is an application of Stack Data Structure?


a)
  1. Managing function calls

b)
  1. The stock span problem

c)
  1. Arithmetic expression evaluation

d)

  1. All of the above