0% found this document useful (0 votes)
76 views2 pages

Jadavpur University Session 2021-2022, Odd Semester Computer Programming and Numerical Methods

The document contains 10 problems involving arrays and matrices in C programming. The problems include: [1] reversing the elements of an integer array, [2] counting duplicate elements in an array and copying non-duplicates to another array in reverse order, [3] performing sum, difference and product operations on 3x3 matrices, and [4] finding the standard deviation of a set of numbers. The remaining problems involve sorting arrays, finding range/maximum/minimum values, transposing matrices, and implementing Kaprekar's routine to find the fixed point number.

Uploaded by

Arkajyoti Naskar
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)
76 views2 pages

Jadavpur University Session 2021-2022, Odd Semester Computer Programming and Numerical Methods

The document contains 10 problems involving arrays and matrices in C programming. The problems include: [1] reversing the elements of an integer array, [2] counting duplicate elements in an array and copying non-duplicates to another array in reverse order, [3] performing sum, difference and product operations on 3x3 matrices, and [4] finding the standard deviation of a set of numbers. The remaining problems involve sorting arrays, finding range/maximum/minimum values, transposing matrices, and implementing Kaprekar's routine to find the fixed point number.

Uploaded by

Arkajyoti Naskar
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/ 2

Jadavpur University

Session 2021-2022, Odd Semester


Computer Programming and Numerical Methods
Group A3, BCSE 1

Array

1. Write a program in C to reverse the contents of the elements of an integer array.

2. Write a program in C to read n number of values in an array. After that, count the total number
of duplicate elements in that array. Then copy the elements except the duplicate elements of
that array into another array and display this array in reverse order.

3. Write a menu-driven program for accepting values in two square matrices of 3x3 dimension and
generate their sum, difference and product.

4. Write a program to find the range of a set of integers entered by the user. Range is the difference
between the smallest and biggest number in the list.

5. Write a C program which accepts ten integers from the user and prints them in ascending order.
Use an array to store the integers.

6. Write a C program which accepts roll numbers of ten students and marks obtained by them in
five subjects and prints the names of the students who have obtained highest and second
highest marks subject wise.

7. Write a C program which accepts a matrix and prints its transpose.

8. Write a C program to replace a square matrix by its transpose without using a second matrix.

9. Consider the following procedure:

i. Take as input any four-digit number, using at least two different digits. (Leading zeros are
allowed.)

ii. Arrange the digits in descending and then in ascending order to get two four-digit
numbers, adding leading zeros if necessary.

iii. Subtract the smaller number from the bigger number. Let the difference be the new four
digit number.

iv. Go back to step ii.


The above process, known as Kaprekar's routine, will always reach a fixed point (Known as
Kaprekar Constant). Write a C-Code to implement the algorithm given above and find out the
constant number. Also create an output file ‘output.dat’ in the working folder and write the
following with appropriate format for each step of iteration: The 4-digit number, the larger
number, the smaller number and the difference of the larger and the smaller number.

Note:

A. The fixed point is achieved when in two consecutive steps the same number is obtained

B. In C the binary arithmetic operation m%n gives the remainder when m is divided by n

10. Write a program which takes some numbers and computes the standard deviation of them.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy