Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

ASSIGNMENT NO: 03

Subject: PROBLEM SOLVING USING COMPUTERS (CSE 1001)


DURATION: 30 Minutes

1. Write a C++ program using linear search to check whether the given number is part of a list of
numbers stored in the array along with location as per the following specifications. The program should
display the desired result and meaningful messages as under. (Proper input output 1 marks and
remaining code 3 marks(1.5 marks each for sorting &searching) )
a. Enter the Dimension:
b. Enter Values:
c. Input array:
d. Output array:
e. For searching the values should be in sorted order:
f. Sort in ascending Order using bubble sort method:
g. Print the values of array after sorting:
h. Enter the value to be searched:
i. Display the Value and its location in the list:

2. Write a c++ program to read a row x column integer elements to 2D array and replace non
Armstrong number by its factorial. Display the original array and the modified 2d array in matrix
format.

3. Write a c++ program to find the all occurrence of a sub string in a given main string with their
positions of occurrences.

4A. What are the rules of passing 1D array and 2D array to a function?

4B. Write a function fact ( ) to find the factorial of a given integer n. Use the above function fact ( )
to find the value of nCr for the given n and r [nCr=n! / (r!* (n - r)!)].

5A. List and explain the working of the two operators used to achieve parameter passing by
reference in C++.

5B. Write a C++ program using functions to reverse n names and display the reversed n names in
the main function.

You might also like