WorksheetsQuiz 1
Total questions: 75
Worksheet time: 35mins
What will happen when the following code is executed?
void main()
{
printf("BBDU");
main();
}
Wrong statement
It will keep on printing BBDU
It will print BBDU once
None of these
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 = 10, c = 10
a = 11, c = 10
a = 10, c = 11
a = 11, c = 11
What will the result of 'num' variable after execution of the following statements?
int num = 58;
num % = 11;
3
5
8
11
What will the result of num1 variable after execution of the following statements?
int j = 1, num1 = 4;
while (++j <= 10)
{
num1++;
}
11
12
13
14
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);
}
10, 10
10, 11
11, 10
11, 11
Give the following declarations and an assignment statement. Which one is equivalent to the expression str [4]?
char str[80];
char * p;
p = str;
p + 4
*p + 4
*(p + 4)
p[3]
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");
}
hi
hello
no
error
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");
}
inside if
inside else if
inside else
compile time error
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");
}
Depends on the compiler
No print statement
True
False
The value of i after the execution of the following segment is
i = 2;
for( i=0; i>10; i=i+1);
1
2
0
11
The output of the following segment is
int k, n=20;
k=(n>5?(n<=10?100:200):500);
printf("%d",n);
100
200
300
20
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=1, b=1
a=2, b=1
a=1, b=2
a=2, b=2
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);
}
0
1
2
compile time error
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;
}
}
yes
no
yes no
compile time error
int x = 10;
int main()
{
int x = 0;
printf("%d",x);
return 0;
}
10
0
compile error
undefined
What should be the output:
int main()
{
int a = 10/3;
printf("%d",a);
return 0;
}
3.33
3.0
3
0
#include "stdio.h"
int main()
{
int a = 10;
printf("%d", a);
int a = 20;
printf("%d",a);
return 0;
}
1020
1010
2020
Error: Redeclaration of a
What is the output of this C code?
#include <stdio.h>
int main()
{
printf("Hello World! %d \n", x);
return 0;
}
Hello World! x;
Hello World! followed by a junk value
Compile time error
Hello World!
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--);
}
5 3 73
5 4 5 3
6 2 7 4
Syntax Error
Find error/ output in following code
int main ()
{
static int num = 8;
printf ( " %d" , num = num -2 );
if (num != 0)
main ();
}
8 6 4 2
Infinite output
Invalid because main function can't call it self
6 4 2 0
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;
}
Infinite time
11 times
0 time
10 times
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 );
}
36 64
35 62
36 63
30 28
Find error/ output in following code
void fn ()
{
static int i= 10;
printf ( " %d " , ++i );
}
int main ()
{
fn();
fn();
}
10 10
11 12
11 11
12 12
Find error/output in following code
int main ()
{
int m = -10,n =20;
n = ( m < 0) ? 0 : 1;
printf ( " %d %d ", m,n ) ;
}
-10 0
10 20
20 -10
0 1
Find error/ output in following code
int main ()
{
int i = 0;
for ( ; ;)
printf ( "%d", i) ;
return 0;
}
O times
Infinite times
10 times
1 times
Which of the following is an example of a DBMS
SQL
Microsoft Office
PHP
Oracle
__________ are the building blocks of a database.
Data
Tables
Records
Fields
A database stores a vast amount of data, but _____________ helps us to retrieve the filtered data based upon some conditions.
forms & reports
reports
queries
forms & queries
CREATE TABLE employee (name VARCHAR, id INTEGER)
What type of statement is this?
DML
View
DDL
DCL
The command used to delete a particular column in a relation is ____________
A.UPDATE TABLE
B.TRUNCATE COLUMN
C.ALTER , DROP
D.DELETE COLUMN
In SQL, which command is used to SELECT only one copy of each set of duplicable rows
A. SELECT DISTINCT
B. SELECT UNIQUE
C. SELECT DIFFERENT
D. All of the above
A database management system (DBMS) is a collection of programs that enables users to
create a database
manipulate a database
both create and manipulate a database
for storing data only
a column
Which word is missing from the following SQL statement?
Select * table_name
With
Where
From
And
It is a DML command that is used to display record.
DISPLAY
STRUCTURE
WHERE
SELECT
What is the meaning of DCL?
Data Count Language
Database Control Language
Data Calculation Language
Data Control Language
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”?
SELECT * FROM Persons WHERE FirstName=’a’
SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
SELECT * FROM Persons WHERE FirstName=’%a%’
SQL query to find all the cities whose humidity is 95.
SELECT city WHERE humidity = 95
SELECT city FROM weather WHERE humidity = 95
SELECT humidity = 89 FROM weather
SELECT city FROM weather
1. The ---------- diagram gives a logical structure of the database graphically
a) Entity-Relationship
b) Entity
c) Architectural Representation
d) Database
Which of the following commands is used to display the directory attributes
cat
ls
mkdir
cp
Which command is used to remove a file?
remove
del
rm
mv
The following command can list out all the current active logins.
A - whoami
B - who am i
C - who
D - None of the above.
If the command cat x is executed after successfully executing the command time sort filename > x, then
only the time details will be displayed
only the sorted contents of the file filename will be displayed
an error message will be displayed
None of the above
Which option is used to removes all the spaces in between the text in echo command
\d
\c
\b
\a
Unix shell command that lists directory contents of files and directories with hidden files.
ls -d
ls -F
ls -a
ls -l
In Unix, Combining commands are
& %
&& %
; &&
; &
How to find out whether a command is internal or external?
cat
home
pwd
type
To find out what your path is, at the Unix shell prompt________
$echo PATH
$echo $path
$echo $PATH
none of the above
On a Unix system, the ______________ refers to a privileged account with unrestricted access to all files and commands
root user
home user
unknown user
super user
The term A.I is short for?
Anatomy Insector
Astrology Iselin
Artificial Intelligence
Antificial Intelligence
Which one of these is not an area of AI?
computer vision/image recognition
voice recognition
web design
robotics
Why do machines demonstrate artificial intelligence?
Because machines are not really intelligent compare to humans.
Because machines are capable of doing tasks for humans by programming them with a specific information.
Because machines are useful and relevant in our daily lives.
Because machines give you artificial information which are important.
How does artificial intelligence become useful to society?
It becomes helpful in completing tasks quickly and efficiently thus producing more products
It becomes helpful in completing tasks quickly thus makes people lazy
It becomes helpful in making task easier and less efficient resulting to the boost of economy.
It helps us to complete our task.
The following statements describe Artificial Intelligence EXCEPT
AI is very useful in the present generation increasing its productivity.
Al is a threat if mismanaged or used for bad intentions.
AI replaces humans as it is more efficient than humans.
All of the above
How does Weak AI differs from Strong AI?
Weak AI contains basic information like programmed response while Strong AI contains high cognitive information like the ability to reason.
Weak AI is a developing type of intelligence while the Strong AI is already established.
Strong AI is better than weak AI because it is an improved version.
Strong AI is widely used compare to Weak AI.
Which of the following statements best describes the difference between robots and humans?
Robots move differently and made up of metal.
Robots do not have feelings and emotions as compared to humans.
Robots are too smart as compared to humans.
Robots are more effective than humans.
It is a device module, or system used in electronic gadgets and materials to detect events and changes.
Electrons
Motor
Sensor
detector
What is AI used for?
Healthcare
Transportation
Education
All of the Above
Which of the following is NOT a goal or feature of AI?
Reasoning/decision making
Forward planning
Displaying emotion
Natural Language
What means was devised to help work out whether or not a computer can think like a human?
IQ test
AI test
Turing Test
Machine Learning
Which of these does NOT use machine learning/AI?
driverless cars
SIRI/Alexa
Sonos wireless speakers
facial recognition on your phone
Which of these is NOT an AI technology
Facial recognition
Image recognition
Robotics
Animation
Which of the following tasks would an AI be able to perform the LEAST successfully?
Suggesting what someone might want to buy from a shopping website
Using traffic data to work out what cars people are likely to buy
Playing hangman
Writing a joke
Why haven't scientists been completely successful when developing AI?
They do not have the time or money
The human brain is very simple
The human brain is very complex
They are trying to replicate the human heart
Which of the following is not an example of Artificial Intelligence?
Chess Playing Computers
Self Driving Cars
Face Recognising Devices
Money Counting Machines
Alexa is a type of ............
chatter box
chatbox
chatbot
chat box
In which year do you think the term 'Artificial Intelligence' was coined?
1950
1960
1966
1956
Identify the bot in the picture.
Sophia
Asimo
Swati
sofil
Which of these is not a type of machine learning?
Superficial Learning
Supervised Learning
Unsupervised Learning
Reinforcement Learning
Which type of learning is shown here?
Supervised Learning
Unsupervised Learning
Reinforcement Learning
Deep Learning
The role of neural networks comes under which type of learning?
Supervised
Unsupervised
Reinforcement
Deep Learning
Which of these does not use NLP?
Translation Tools
Email Filters
Facial Recognition
Autocomplete Feature
Which of the following does not belong to the stage ' Data Exploration'?
Gathering Data
Data Analysis
Data Preparation
Data Wrangling
