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

Write A Program To Calculate All The Prime Numbers of Inputs Entered by The User

The document outlines exercises for programming tasks, including calculating prime numbers and determining if a number is prime. It also explains multidimensional arrays, their declaration, and traversing methods, along with examples of matrix operations such as addition and determinant calculation. Additionally, it mentions an assignment to make notes on the struct data structure.

Uploaded by

dihoncho.pro
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)
5 views2 pages

Write A Program To Calculate All The Prime Numbers of Inputs Entered by The User

The document outlines exercises for programming tasks, including calculating prime numbers and determining if a number is prime. It also explains multidimensional arrays, their declaration, and traversing methods, along with examples of matrix operations such as addition and determinant calculation. Additionally, it mentions an assignment to make notes on the struct data structure.

Uploaded by

dihoncho.pro
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

Exercise

1. Write a program to calculate all the prime numbers of inputs entered by the user.
2. Write a function to determine if a number is prime, if it is prime, return 1 else return 0.

Multidimension arrays:
This is an array with rows and columns. E.g. 2D arrays. It is represented as: 0 1 2 3
0 9 3 -4 9
1. Definition 1 7 11 17 10
2. Illustration 2 14 0 19 12
3. Declaration 3 20 18 17 3
4. Traversing {
For (i=0; i<N; i++) { M [1][2] = 17;
For (j= 0; j<N; j++) {
Write(M[i][j];
}
}

Int [4][4]

Char me [10][15];

Examples of application:
Write a program that adds 2 ,2 by 2 metrices given by a user
Exercise
• Write a program that collect the two by two matrix of the user and display it’s
determinant.
• Write a program that add two n by n metrices given by the user.
• Write a program that calculate the determinants of two by two matrix.
• NB: you may a function called det2 which returns the determents of a two by
two matrix.
• Look for the determinant of a three by three matrix

Assignment:
Make notes on struct data structure.

You might also like