Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Quiz 1

Total questions: 75

Worksheet time: 35mins

Name
Class
Date
1.

What will happen when the following code is executed?

void main()

{

printf("BBDU");

main();

}

a)

Wrong statement

b)

It will keep on printing BBDU

c)

It will print BBDU once

d)

None of these

2.

What is the result after execution of the following code if a is 10, b is 5, and c is 10?

if ((a > b) && (a <= c))

a = a + 1;

else

c = c+1;

a)

a = 10, c = 10

b)

a = 11, c = 10

c)

a = 10, c = 11

d)

a = 11, c = 11

3.

What will the result of 'num' variable after execution of the following statements?

int num = 58;

num % = 11;

a)

3

b)

5

c)

8

d)

11

4.

What will the result of num1 variable after execution of the following statements?

int j = 1, num1 = 4;

while (++j <= 10)

{

num1++;

}

a)

11

b)

12

c)

13

d)

14

5.

What will be the output of the following code?

#include <stdio.h>

int main()

{

int *ptr, a = 10;

ptr = &a;

*ptr += 1;

printf("%d,%d/n", *ptr, a);

}

a)

10, 10

b)

10, 11

c)

11, 10

d)

11, 11

6.

Give the following declarations and an assignment statement. Which one is equivalent to the expression str [4]?

char str[80];

char * p;

p = str;

a)

p + 4

b)

*p + 4

c)

*(p + 4)

d)

p[3]

7.

What will be the output of the following C code?

#include <stdio.h>

void main()

{

int x = 5;

if (x < 1)

printf("hello");

if (x == 5)

printf("hi");

else

printf("no");

}

a)

hi

b)

hello

c)

no

d)

error

8.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int x = 0;

if (x == 1)

if (x == 0)

printf("inside if\n");

else

printf("inside else if\n");

else

printf("inside else\n");

}

a)

inside if

b)

inside else if

c)

inside else

d)

compile time error

9.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int x = 0;

if (x == 1)

if (x >= 0)

printf("true\n");

else

printf("false\n");

}

a)

Depends on the compiler

b)

No print statement

c)

True

d)

False

10.

The value of i after the execution of the following segment is

i = 2;

for( i=0; i>10; i=i+1);

a)

1

b)

2

c)

0

d)

11

11.

The output of the following segment is

int k, n=20;

k=(n>5?(n<=10?100:200):500);

printf("%d",n);

a)

100

b)

200

c)

300

d)

20

12.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int a = 1, b = 1, c;

c = a++ + b;

printf("%d, %d", a, b);

}

a)

a=1, b=1

b)

a=2, b=1

c)

a=1, b=2

d)

a=2, b=2

13.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int i = 0;

int j = i++ + i;

printf("%d\n", j);

}

a)

0

b)

1

c)

2

d)

compile time error

14.

What will be the output of the following C code?

#include <stdio.h>

int main()

{

int a = 1, b = 1;

switch (a)

{

case a*b:

printf("yes ");

case a-b:

printf("no\n");

break;

}

}

a)

yes

b)

no

c)

yes no

d)

compile time error

15.

int x = 10;


int main()

{

int x = 0;

printf("%d",x);

return 0;

}

a)

10

b)

0

c)

compile error

d)

undefined

16.

What should be the output:

int main()

{

int a = 10/3;

printf("%d",a);

return 0;

}

a)

3.33

b)

3.0

c)

3

d)

0

17.

#include "stdio.h"

int main()

{

int a = 10;

printf("%d", a);

int a = 20;

printf("%d",a);

return 0;

}

a)

1020

b)

1010

c)

2020

d)

Error: Redeclaration of a

18.

What is the output of this C code?

#include <stdio.h>

int main()

{

printf("Hello World! %d \n", x);

return 0;

}

a)

Hello World! x;

b)

Hello World! followed by a junk value

c)

Compile time error

d)

Hello World!

19.

Find the output in following code

int main ()

{

int a,b ;

a= b= 4 ;

b =a++;

printf ( " %d %d %d %d", a++, --b, ++a, b--);

}

a)

5 3 73

b)

5 4 5 3

c)

6 2 7 4

d)

Syntax Error

20.

Find error/ output in following code

int main ()

{

static int num = 8;

printf ( " %d" , num = num -2 );

if (num != 0)

main ();

}

a)

8 6 4 2

b)

Infinite output

c)

Invalid because main function can't call it self

d)

6 4 2 0

21.

Find error/ output in following code

How many times " placement Questions" will print.

int main()

{

int x;

for ( x=1;x <=10; x++)

{

if ( x < 5)

continue;

else

break;

printf (" placement Question ");

}

return 0;

}

a)

Infinite time

b)

11 times

c)

0 time

d)

10 times

22.

Find error/ output in following code

int main ()

{

int a = 10, b = 25;

a = b++ + a++;

b= ++b + ++a;

printf ( " %d %d n", a, b );

}

a)

36 64

b)

35 62

c)

36 63

d)

30 28

23.

Find error/ output in following code

void fn ()

{

static int i= 10;

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

}

int main ()

{

fn();

fn();

}

a)

10 10

b)

11 12

c)

11 11

d)

12 12

24.

Find error/output in following code

int main ()

{

int m = -10,n =20;

n = ( m < 0) ? 0 : 1;

printf ( " %d %d ", m,n ) ;

}

a)

-10 0

b)

10 20

c)

20 -10

d)

0 1

25.

Find error/ output in following code

int main ()

{

int i = 0;

for ( ; ;)

printf ( "%d", i) ;

return 0;

}

a)

O times

b)

Infinite times

c)

10 times

d)

1 times

26.

Which of the following is an example of a DBMS

a)

SQL

b)

Microsoft Office

c)

PHP

d)

Oracle

27.
A DBMS system is made up of:
a)
queries, forms, reports
b)
tables, entities, fields
c)
rows, columns, criteria
d)
data and commands
28.

__________ are the building blocks of a database.

a)

Data

b)

Tables

c)

Records

d)

Fields

29.

A database stores a vast amount of data, but _____________ helps us to retrieve the filtered data based upon some conditions.

a)

forms & reports

b)

reports

c)

queries

d)

forms & queries

30.

CREATE TABLE employee (name VARCHAR, id INTEGER)

What type of statement is this?

a)

DML

b)

View

c)

DDL

d)

DCL

31.

The command used to delete a particular column in a relation is ____________

a)

A.UPDATE TABLE

b)

B.TRUNCATE COLUMN

c)

C.ALTER , DROP

d)

D.DELETE COLUMN

32.

In SQL, which command is used to SELECT only one copy of each set of duplicable rows

a)

A. SELECT DISTINCT

b)

B. SELECT UNIQUE

c)

C. SELECT DIFFERENT

d)

D. All of the above

33.

A database management system (DBMS) is a collection of programs that enables users to

a)

create a database

b)

manipulate a database

c)

both create and manipulate a database

d)

for storing data only

34.
A database entity is also known as:
a)
a table
b)
a field
c)
a row
d)

a column

35.

Which word is missing from the following SQL statement?


Select * table_name

a)

With

b)

Where

c)

From

d)

And

36.

It is a DML command that is used to display record.

a)

DISPLAY

b)

STRUCTURE

c)

WHERE

d)

SELECT

37.

What is the meaning of DCL?

a)

Data Count Language

b)

Database Control Language

c)

Data Calculation Language

d)

Data Control Language

38.

With SQL, how do you select all the records from a table named “Persons” where the value of the column “FirstName” ends with an “a”?

a)

SELECT * FROM Persons WHERE FirstName=’a’

b)

SELECT * FROM Persons WHERE FirstName LIKE ‘a%’

c)

SELECT * FROM Persons WHERE FirstName LIKE ‘%a’

d)

SELECT * FROM Persons WHERE FirstName=’%a%’

39.

SQL query to find all the cities whose humidity is 95.

a)

SELECT city WHERE humidity = 95

b)

SELECT city FROM weather WHERE humidity = 95

c)

SELECT humidity = 89 FROM weather

d)

SELECT city FROM weather

40.

1. The ---------- diagram gives a logical structure of the database graphically

a)

a) Entity-Relationship

b)

b) Entity

c)

c) Architectural Representation

d)

d) Database

41.

Which of the following commands is used to display the directory attributes

a)

cat

b)

ls

c)

mkdir

d)

cp

42.

Which command is used to remove a file?

a)

remove

b)

del

c)

rm

d)

mv

43.

The following command can list out all the current active logins.

a)

A - whoami

b)

B - who am i

c)

C - who

d)

D - None of the above.

44.

If the command cat x is executed after successfully executing the command time sort filename > x, then

a)

only the time details will be displayed

b)

only the sorted contents of the file filename will be displayed

c)

an error message will be displayed

d)

None of the above

45.

Which option is used to removes all the spaces in between the text in echo command

a)

\d

b)

\c

c)

\b

d)

\a

46.

Unix shell command that lists directory contents of files and directories with hidden files.

a)

ls -d

b)

ls -F

c)

ls -a

d)

ls -l

47.

In Unix, Combining commands are

a)

& %

b)

&& %

c)

; &&

d)

; &

48.

How to find out whether a command is internal or external?

a)

cat

b)

home

c)

pwd

d)

type

49.

To find out what your path is, at the Unix shell prompt________

a)

$echo PATH

b)

$echo $path

c)

$echo $PATH

d)

none of the above

50.

On a Unix system, the ______________ refers to a privileged account with unrestricted access to all files and commands

a)

root user

b)

home user

c)

unknown user

d)

super user

51.

The term A.I is short for?

a)

Anatomy Insector

b)

Astrology Iselin

c)

Artificial Intelligence

d)

Antificial Intelligence

52.

Which one of these is not an area of AI?

a)

computer vision/image recognition

b)

voice recognition

c)

web design

d)

robotics

53.

Why do machines demonstrate artificial intelligence?

a)

Because machines are not really intelligent compare to humans.

b)

Because machines are capable of doing tasks for humans by programming them with a specific information.

c)

Because machines are useful and relevant in our daily lives.

d)

Because machines give you artificial information which are important.

54.

How does artificial intelligence become useful to society?

a)

It becomes helpful in completing tasks quickly and efficiently thus producing more products

b)

It becomes helpful in completing tasks quickly thus makes people lazy

c)

It becomes helpful in making task easier and less efficient resulting to the boost of economy.

d)

It helps us to complete our task.

55.

The following statements describe Artificial Intelligence EXCEPT

a)

AI is very useful in the present generation increasing its productivity.

b)

Al is a threat if mismanaged or used for bad intentions.

c)

AI replaces humans as it is more efficient than humans.

d)

All of the above

56.

How does Weak AI differs from Strong AI?

a)

Weak AI contains basic information like programmed response while Strong AI contains high cognitive information like the ability to reason.

b)

Weak AI is a developing type of intelligence while the Strong AI is already established.

c)

Strong AI is better than weak AI because it is an improved version.

d)

Strong AI is widely used compare to Weak AI.

57.

Which of the following statements best describes the difference between robots and humans?

a)

Robots move differently and made up of metal.

b)

Robots do not have feelings and emotions as compared to humans.

c)

Robots are too smart as compared to humans.

d)

Robots are more effective than humans.

58.

It is a device module, or system used in electronic gadgets and materials to detect events and changes.

a)

Electrons

b)

Motor

c)

Sensor

d)

detector

59.

What is AI used for?

a)

Healthcare

b)

Transportation

c)

Education

d)

All of the Above

60.

Which of the following is NOT a goal or feature of AI?

a)

Reasoning/decision making

b)

Forward planning

c)

Displaying emotion

d)

Natural Language

61.

What means was devised to help work out whether or not a computer can think like a human?

a)

IQ test

b)

AI test

c)

Turing Test

d)

Machine Learning

62.

Which of these does NOT use machine learning/AI?

a)

driverless cars

b)

SIRI/Alexa

c)

Sonos wireless speakers

d)

facial recognition on your phone

63.

Which of these is NOT an AI technology

a)

Facial recognition

b)

Image recognition

c)

Robotics

d)

Animation

64.

Which of the following tasks would an AI be able to perform the LEAST successfully?

a)

Suggesting what someone might want to buy from a shopping website

b)

Using traffic data to work out what cars people are likely to buy

c)

Playing hangman

d)

Writing a joke

65.
Who was this man?
a)
John von Neumann
b)
Donald Knuth
c)
Alan Turing
d)
Tim Berners-Lee
66.

Why haven't scientists been completely successful when developing AI?

a)

They do not have the time or money

b)

The human brain is very simple

c)

The human brain is very complex

d)

They are trying to replicate the human heart

67.

Which of the following is not an example of Artificial Intelligence?

a)

Chess Playing Computers

b)

Self Driving Cars

c)

Face Recognising Devices

d)

Money Counting Machines

68.

Alexa is a type of ............

a)

chatter box

b)

chatbox

c)

chatbot

d)

chat box

69.

In which year do you think the term 'Artificial Intelligence' was coined?

a)

1950

b)

1960

c)

1966

d)

1956

70.

Identify the bot in the picture.

a)

Sophia

b)

Asimo

c)

Swati

d)

sofil

71.

Which of these is not a type of machine learning?

a)

Superficial Learning

b)

Supervised Learning

c)

Unsupervised Learning

d)

Reinforcement Learning

72.

Which type of learning is shown here?

a)

Supervised Learning

b)

Unsupervised Learning

c)

Reinforcement Learning

d)

Deep Learning

73.

The role of neural networks comes under which type of learning?

a)

Supervised

b)

Unsupervised

c)

Reinforcement

d)

Deep Learning

74.

Which of these does not use NLP?

a)

Translation Tools

b)

Email Filters

c)

Facial Recognition

d)

Autocomplete Feature

75.

Which of the following does not belong to the stage ' Data Exploration'?

a)

Gathering Data

b)

Data Analysis

c)

Data Preparation

d)

Data Wrangling