0% found this document useful (0 votes)
53 views

To Learn The Concepts of Arrays (1D &2D), Strings, Pointers, Fuction and Recursion

This document contains a lab assignment on introduction to computer programming. It includes 7 questions covering arrays, strings, pointers, functions, and recursion. The objectives are to learn these core programming concepts. Students must write programs to merge sorted arrays, print string permutations, check matrix symmetry, fill a matrix, find quadratic roots with call by reference, define a recursive function, and create a guessing game. The learning outcome is for students to develop basic programs using these fundamental programming elements.

Uploaded by

ayush gupta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

To Learn The Concepts of Arrays (1D &2D), Strings, Pointers, Fuction and Recursion

This document contains a lab assignment on introduction to computer programming. It includes 7 questions covering arrays, strings, pointers, functions, and recursion. The objectives are to learn these core programming concepts. Students must write programs to merge sorted arrays, print string permutations, check matrix symmetry, fill a matrix, find quadratic roots with call by reference, define a recursive function, and create a guessing game. The learning outcome is for students to develop basic programs using these fundamental programming elements.

Uploaded by

ayush gupta
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Shri G. S.

Institute of Technology and Science


Department Of Computer Engineering
CO 10504: Introduction to Computer Programming
Lab Assignment # 03(A2)
Objectives:
To learn the concepts of arrays(1D &2D), strings, pointers,fuction and recursion.
Note: Bonus 5 marks for Question 7.

Questions:

1. Given are two 1-D arrays A and B which are stored in ascending order. Write a
program to merge them into a single sorted array C that contains every item from
arrays A and B in descending order.

2. Write a program to print all permutations of a given string.

3. Write a program to find that a given 3*3 matrix is symmetric or skew symmetric.

4. Take a five-by-five matrix and fill it- (i) Upper right triangle with +1, (ii) Lower left
Triangle with -1, (iii) left to right diagonal with 0.

5. Write a program to find roots of quadratic equation using call by reference.

6. Write a recursive function print_term() which takes as argument an integer and


returns the value of t(n) where t(n) is defined as follows:

t(0)=0,

t(1)=1,

t(2)=2,

t(n)=3*t(n-1)*t(n-2)-2*t(n-2)*t(n-3)+1

7. Guessing Game: Guess a number between 1 and 100 in your(user's) mind. Write a
program so that the computer will ask you a series of questions & determine that
number based on your answers.

_______________________________________________________________
Learning Outcomes:

Students will learn to develop basic programs using concepts of 1-D and 2-D
arrays, strings, functions, recursion and pointers.

You might also like