0% found this document useful (0 votes)
15 views5 pages

SPT Question Bank

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

SPT Question Bank

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

unit 1

1 Explain the structure of a typical C program. Give an example and explain each section in detail.
2 Write a program in C to find the reverse of a four digit number entered by the user
3 Give the syntax of following C control statements with example.i) if – else ii) for loop iii) while loop
4 Write a program in C to determine whether a entered number is a prime number or not.
5 What are various data types available in ''C''? Define constant and variable
6 Write a program in ''C'' to add the digits of a four digit number. Number is entered by user.

7 Explain different operators available in "C"


8 Write a program in ''C'' to calculate net salary using formula, Gross salary = Basic + DA + HRA,Net
salary = Gross salary – PT using condition, if Basic 2500, PT = 150, HRA = 1200 & DA = 50%
of Basic if Basic < 2500, PT = 100, HRA = 10% of Basic,DA = 25% of BASIC
9 What are the program control statements available in 'C'? Explain in brief.
10 Explain various storage classes available in 'C'. State the importance of storage class
11 Define the terms with example.
i) Keywords.
ii) Identifiers.
iii) Variables and constants
12 Give the syntax of the following control statements with example.
i) Do-while loop. ii) If-else. iii) While loop.
unit 2
1 Define an array. Write syntax for initialising 1 – D and 2 – D array. Explain with example.
2 Write a program in C to find the addition of a 3*3 matrix.
3 Explain different methods of searching an element in an array. Explain linear search technique.
4 Write a program in C to arrange the elements of a array of size 10 in ascending order using
selection sort.
5 What is a structure? How does it differ from an array. Explain memory allocation for structure. Give
one example.
6 Write a program in C to print details of 10 books using array of structure. The structure should
contain name, price and pages.
7 Write and explain the syntax of following functions : i) fopen ( ) ii) fclose ( ) iii) fseek ( )

8 Define a Pointer. Explain 'Call by Value' and 'Call by Reference' with an example.
9 What are various methods to initialize an array? Explain with example
10 Write a program to calculate sum of diagonal elements of a 4 *4 matrix
11 What do you mean by searching? What are different methods of searching?
12 Write a program in ''C'' to sort 5 elements of an array using bubble sort method
13 What is a pointer? State the importance of a pointer along with an application.
14 Describe any three file function available in "C"
15 Write a structure of store and display information of 5 students. Information should be name,
marks and parentage
16 What do you understand by 'Array'? Explain the methods of initialization of array elements with
example
17 Write a program to calculate average of 20 numbers using array
18 Explain different methods of searching an element in an array. Explain binary search technique.
19 Write a C program for finding sum of two 3 x 3 matrices. Resultant matrix must be printed as output
of the program
20 What is a pointer? Write a program in 'C' to interchange values of two variables using pointers.
21 What is meant by the following terms? i) Nested Structure ii) Array of Structures
22 Write a program to arrange the elements of an array of size 10 in ascending order use selection
sort method

unit 3
1 What are the elements of object oriented programming? Explain objects and classes with example.

2 What is the difference between object oriented programming and procedure oriented
programming?
3 Write short notes on : i) Data Abstraction. ii) Poly morphism. iii) Data Hiding and Encapsulation.
iv) Inheritance and Multiple Inheritance.iv) Objects & classes
4 What are important characteristics of ''C++''? Explain them in brief
5 What are objects and classes in C++? Explain with example
6 Explain the characteristics of object oriented programming
7 What is Inheritance? Explain multiple Inheritances

unit 4
1 Explain in brief about various files that can be created in MATLAB and importance of these files.
2 Write a MATLAB program to find the largest of the given three numbers (10, 20, 30) using if – else
if – else structure.
3 Write syntax for following in MATLAB along with example.
i) if – else ii) for loop
iii) while loop
4 Write a program in MATLAB to find the factorial of a number. The number is entered by user
5
Write a program in MATLAB to find sum and average of marks in 3 game
6 Write a MATLAB program to find the largest of given three numbers (10, 20, 30)
7 Explain the purpose of following MATLAB commands :
i) lookfor
ii) rank
iii) title
8 hat are the various decision making statements available in MATLAB? Explain the
switch - case statement with an example
9 Write a MATLAB program to print Fibonacci series upto 50 terms
10 Explain the different looping structures available in MATLAB with example

unit 5
1 Write a MATLAB program to plot the curve given by equation y sin(x) = , as x varies from 0 to 2 .
Label the axes and provide a suitable title for plot. Show the Schematic for MATLAB output.
2 i) Delete first row of matrix P. ii) Reshape matrix as a (6 *2) matrix. iii) Replace the element P(3,2)
by 10. iv) Delete the second column of matrix P.
3 If A [1,2,3;4,5,6;7,8,9 ]=write a MATLAB program to find i) transpose ii) inverse iii) determinant iv)
rank of matrix
4 Explain the following commands in MATLAB with example. i) linspace 1 2 (x , x ,n) ii) who iii) sort
(A) iv)X A / B
5 Explain following MATLAB commands with example. i) Plot ii) Xlabel iii) Title
6 In MATLAB, how to find matrix inverse, determinant and transpose? Explain with the help of
example
7 Draw a circle of unit radius using method of plotting of graph in MATLAB using equation of unit
circle. x cos , y sin ,0 2 .
8 Write a MATLAB program for sorting the given array in ascending order by using bubble sort
mechanism. A =[17,4,23,68,9,12,42 ]
9 Find transpose, inverse and determinant of the matrix X =[10,12,14; 4,8,9; 24,12,6 ]
10 Write a syntax using functions in MATLAB:
i) For creating data file.
ii) For writing to a text file.
iii) Creating a data matrix X of size m by n matrix

You might also like