You are on page 1of 8

JAI GURU DEV

MAHARISHI INTERNATIONAL RESIDENTIAL SCHOOL

CLASS- 9

CHOOSE THE CORRECT ANSWER

1. Which among the following is a pre-tested loop?


a. do-while loop b. for loop c. While loop
2. Which among the following skips the current execution?.
a. break b. continue c. None
3. A for loop can be written by skipping the following part
a. Initialization b. Initialization & condition c. None
4. The process dividing the complex programs into sub-programs is called as
a. functions b. tasks c. activities
5. The programming using functions is also called as
a. Modular Programming b. Sub programming
6. Actual parameters are written inside
a. Function declaration b. Function definition c. Function call
7. Group of elements with same data type is called as
a. Union b.Array c. Structure
8. Which of the following functions is used to convert the lower case string into upper
case string?
a. strlen() b. strlwr() c.strupr()
9. Which of the following function is used to compare two strings?.
a. Strcmp() b.strrev() c.strcpy()
10. Which of the following function is used to join two strings?
a.strcpy() b. strcmp() c.strcat()
11. A group of elements with dissimilar data type is called as
a. Array b. Structure c. None
12. Which of the following operator is used to access the members of structure?
a. Dot operator b. * c. +

Fill in the blanks:

1. The Looping is defined as repeating the same process multiple times..


2. Initialization, Condition & Increment/decrement are three factors important in
looping.
3. While & for loop is called as entry-controlled loop.
4. Break statement is used to terminate all the futher iterations.
5. The concept of function approach is also called as Divide and Conquer
approach.
6. Actual parameters are written inside the function definition.
7. Main function is also called as Built-in function.
8. The changes done in the formal parameter will have impact on Call by reference
method.
9. ARRAYS are group of elements using common data type.
10. One dimensional arrays have only one subscript.
11. Garbage values will be assigned until the used initialize the first index position of
the array.
12. Sequential search process is used to find the element in the array.
13. The Sorting process is used to arrange the elements in ascending order.
14. Structures are groups of elements having dissimilar data type..
15. Long data type share the memory location of highest data type.
16. Nested structure is structure inside a structure.
TRUE OR FALSE
1. Decision making statements are used to repeat the execution. FALSE
2. The expression in a selection statement can have no side effects. FALSE
3. An expression in an if statement should be enclosed within parenthesis.
FALSE
4. If the condition is not specified in the for loop, the loop executes for specified
number of times. FALSE
5. Do while loop is called as pre-tested loop. FALSE
6. While loop and for loop is called as pre-tested loop. TRUE
7. If a for loop ends with semicolon, the control will not enter into the loop.
FALSE
8. In call by value method, the changes done in formal parameters will have
impact on the actual parameter. FALSE
9. The process of functions is also called as divide and conquer approach. TRUE
10. The function which is having the function call statement is called as calling
function. TRUE
11. The function which is having the function definition statement is called as
called function. TRUE
12. Arrays can have values with different data type. FALSE
13. Strings must end up with a null character. True
14. Two dimensional arrays have rows and columns to have table like values.
TRUE
15. Strcat() is used to compare two strings. FALSE
16. Structures can have values with different data type. TRUE
17. Nested structures do not have structures inside it. FALSE

Questions & Answers


1. Define looping process.
A loop is a sequence of instructions that is continually repeated until a certain
condition is reached.

2. Write Syntax of While, Do..while & for loop.


While (condition) do for(Initialization;conditi
{ { on;
Statement( Statement( Increment/decrement)
s); s); {
Increment / Increment / Statement(s);
Decrement; } Decrement; }
} while(condition);

3. Difference between While and do..while loop.


The difference between while and do while loop is that in the while loop the
condition is checked prior to executing any statements whereas in the case of do
while loop, statements are run at least once, and then the condition is verified.
4. What is the purpose of Break statement?.
When a break statement is encountered inside a loop, the loop is immediately
terminated and the program control resumes at the next statement following the
loop.
5. What is the purpose of Continue statement?.
The continue statement in C programming works somewhat like
the break statement. Instead of forcing termination, it forces the next iteration of
the loop to take place, skipping any code in between.

6. Difference between break and continue statement


The primary difference between break and continue statement in C is that the
break statement leads to an immediate exit of the innermost switch or enclosing
loop. On the other hand, the continue statement begins the next iteration of the
while, enclosing for, or do loop.
7. Define function.
A function is a block of code which only runs when it is called.
You can pass data, known as parameters, into a function.
Functions are used to perform certain actions, and they are important
for reusing code: Define the code once, and use it many times.

8. What are the three concepts involved in function.


Function declaration, Function calling & Function definition

9. What are the two types of parameters?


Actual parameters: The parameters which are written inside the function call
are called as actual parameters.
Formal parameters: The parameters which are written in the function
definition is called as formal parameters.

10. What are the four categories of function?.


Function definition with arguments and with return value. b. Function definition
with arguments and without return value. C. Function definition without arguments
and with return value. D. Function definition without arguments and without return
value.

11. What are the parameter passing methods?. Explain.


Call by value: In this method, the value of actual parameters will be directly copied
to the formal parameters.
call by reference: In this method, the address of actual parameters copied to the
formal parameters.

12. What is recursive function?.


It is a function which calls itself again and again until an exit condition.

13. Define Array.


An array is a collection of similar data elements stored at contiguous memory
locations. It is the simplest data structure where each data element can be
accessed directly by only using its index number.

14. What are the two types of arrays?


One dimensional array and two dimensional array.

15. How can arrays be represented?.


Arrays can be represented in dimensions.
1D, 2D & Multi dimensional array

16. How to initialize1 dimensional & 2 dimensional array?.


Compile time initialization and Run time initialization.

17. Define strings.


String in C programming is a sequence of characters terminated with a null
character ‘\0’. Strings are defined as an array of characters. The difference between
a character array and a string is the string is terminated with a unique character ‘\0’.

18. What are the predefined string functions?


strcat() – Used to combine two strings.
strlen() – Used to find the length of the string
strcpy() – Used to copy one string to another
strcmp() – Used to compare whether two strings are equal or not.
strlwr() - Used to convert strings into lower case.
strupr() - Used to convert strings into upper case.
strrev() – Used to reverse the string.
19. Define structure.
Group of elements with dissimilar data type is called as Structure.

20. How do you create a structure?.


A structure is declared using the keyword ‘struct’ followed by the structure name.
Syntax: Struct struct_name
{ data_type Variable name;
Data_type variable name1 }

21. How will you initialize a structure?.


Initializing a structure means assigning some constants to the members of the
structure.
Example: struct student {
int roll_no;
Char name[20];
} s = { 1, “RAJAN”);
ARTIFICIAL INTELLIGENCE

Neural network
Rule Based approach:
Under Rule based approach, the developer feeds in data along with some ground rules to
the model. The model gets trained with these inputs and gives out answers in the form of
predictions. This approach is commonly used when we have a known dataset or labelled
dataset.

Rule Based Approach

Machine Learning approach:


Whereas, under the Machine Learning approach the developer feeds in data along with the
answers. The machine then designs its own algorithms and methodologies to match the
data with answers and gives out the rules. This approach is commonly used when the data
is unknown /random or unlabeled.

Machine Learning Approach

Common AI models:
REGRESSION: This is a type of Rule based AI model. In regression, the algorithm
generates a mapping function from the given data, represented by the solid line. The blue
dots shown in the graph are the data values and the solid line here represents the mapping
done for them. With the help of this mapping function, we can predict the future data. For
example, if we want to predict the salary of an employee, we can use his past salaries as
training data and can predict his next salary. Regression works with continuous data.

CLASSIFICATION: This is another Rule based AI model. In classification, the algorithm is


able to determine which set a given data point belongs to by means of a classification
function represented by the dotted line. The model classifies datasets according to the rules
given to it. Usually the dataset used for classification are labelled and the data then gets
sorted according to their labelling. Testing data is then classified as one of the labels of the
training dataset. For example, If we want to train a model to identify if an image is of a guitar
or a piano, we need to train it with multiple images of both guitar and piano along with their
labels. The machine will then classify images on the basis of the labels and predict the
correct label for testing data. Classification works on discrete dataset.

CLUSTERING: This is a Machine learning approach where the machine generates its own
rules or algorithms to differentiate amongst the given dataset to achieve the pre-decided
goal. The data fed to such a model is usually unlabelled or random and thus the developer
feeds in the data directly into the machine and instructs it to build its own algorithm. The
machine then finds out patterns or trends out of the training dataset and clusters the ones
which follow the same pattern. The output rules might be very different to what was
expected as the machine has its own way of recognising patterns. For example, if you have
a random data of stray dogs which live in your locality, since you are unable to find any
meaningful pattern amongst them, you would feed their data into the clustering algorithm.
The algorithm would then analyse the data and divide them into clusters according to their
similarities based on the trends noticed. The clusters are then given as the output.
Clustering works on discrete dataset.
Neural Network

A neural network is a branch of machine learning called deep learning.

Neural networks are loosely modelled after how neurons in the human brain behave. The
key advantage of neural networks, are that they are able to extract data features
automatically without needing the input of the programmer. A neural network is essentially a
system of organizing machine learning algorithms to perform certain tasks. It is a fast and
efficient way to solve problems for which the dataset is very large, such as in images.

Applications of Neural Network:


Character recognition
Image compression
Stock market Prediction
Voice recognition system
Self-driving cars.

Features of Neural Network


Neural network systems are modelled on the human brain and nervous system
They are able to automatically extract features without input from programmer
Every neural network node is essentially a machine-learning system
Neural network are useful in solving problems for which the data sets are quite large

Neural Networks Vs Human Nervous System

Given are the images of a Human Neuron and its relation with the Neural Network. The axon
from a neuron sends an impulse to the synapse of another neuron. The impulse received is
then sent to the cell body (nucleus) through dendrites. The cell body performs an activation
function on the impulse received and then gives it to the output axon which passes the same
to the next neuron in the system. Now as we relate this process with an Artificial Neural
Network, we can see that the input layer gets data which is passes on to the nodes in the
hidden layer. The nodes perform specific actions on the data and pass the processed
information to the next layer. In the end, the final processed data reaches the output of the
system.
Artificial Neural Network Architecture

ANN(Artificial Neural Network) is made of three layers namely input layer, output
layer, ANN is made of three layers namely input layer, output layer, and hidden
layer/s. There must be a connection from the nodes in the input layer with the nodes
in the hidden layer and from each hidden layer node with the nodes of the output
layer.and hidden layer/s. There must be a connection from the nodes in the input
layer with the nodes in the hidden layer and from each hidden layer node with the
nodes of the output layer.

MCQs

1. ANN stands for


a. Artificial Neural network b. Algorithm neural network
2. Which of these is an approach for developing an AI model?.
a. Layers approach b. Machine-learning approach c. None
3. Which of these statements is not true about the human brain
a. The brain can never be trained as per our wishes
b. Brain cells have dendrites and nuclei
c. We can develop and train our brain to go beyond its actual capabilities
4. A neural network is a branch of machine learning called as
a. Deep learning b. Artificial learning c. none
5. Neural network can be used for
a. Character recognition b. self-driving cars c. stock marlet prediction
d. all of these

6. A neural network is useful when solving a problem for which the data set is
a. Very Large b. small c. very small
7. Which layer gets data which it passes on to the nodes in the hidden layer?.
a. Output b. input c. Both input and output
8. Which of these is not one of the layers in a neural network architecture?
a. Input b. Hidden c.Visible
9. The input layer gets data which it passes on to the ____ in the hidden layer.
a. Dendrite b.axon c. nodes
10. Which of these is not an advantage of an artificial neural network?.
a. It learns and does not need to be reprogrammed.
b. It is large, then it requires a high processing time.
c. It can be performed without any problem.
Fill ups:

1. Under the machine-learning approach the developer feeds in data along with the
answers.
2. Regression is a type of rule-based AI model
3. Clustering works on discrete data set.
4. An Artificial network is inspired by the biological neural networks in the human
brain.
5. An Artificial neural network is composed of artificial neurons or nodes
6. Neural network can be used in Character recognition.
7. Every neural network node is essentially a machine-learning algorithm.
8. The output layer contains units that respond to the information about how it
has learnt any task.
9. Hidden layers are in between input and output layers.
10. A neural network learns and does not need to be reprogrammed.

TRUE or FALSE

1. In the rule-based approach, the developer feeds in data along with some
ground rules to the model. TRUE
2. The machine-learning approach is commonly used when the data is unknown
random or unlabelled. FALSE
3. Clustering is a type of rule-based AI model. FALSE
4. There are many scientific theories saying that humans use hardly 10 percent of
the actual power and potential of their brain.TRUE
5. ANN is inspired by the way biological neural networks in the human kidney
process information. FALSE
6. Deep learning uses the concept of neural networks. TRUE
7. The input layer gets data which it passes on to the nodes in the output layer.
FALSE
8. The output layer contains units that respond to the information about how it has
learnt any task. TRUE
9. Neural network has fault tolerance. TRUE
10. A neural network needs no training to operate. FALSE

----------------------------------------

You might also like