SlideShare a Scribd company logo
October 6 UNI
Department of Computer Science
Structured Programming
Practice Lab (Arrays)
One dimensional array
1- Write a C++ program that accepts an array of 20 elements then apply the following
operations :
A. Reverse the order of the array and display it.
B. Display the sum and the average of the array.
C. Allow user to input a number and search for this number in the array.
2- Write a program to read 20 values from the user, ask the user about a number N, and
display how many numbers of N in this array.
3- Write a program that accepts an array of ten elements and an integer value then find
scalar multiplication.
4- Write a program to find the intersection between array of 10 elements and array o3
elements. For example: if A[10] = { 1,2,3,4,5,6,7,8,9,10 }and B [3] = {2, 5, 11}, result is
2, 5.
5- Write a program to find the union between array of 10 elements and array o3 elements.
For example: if A[10] = { 1,2,3,4,5,6,7,8,9,10 }and B [3] = {2, 5, 11}, result is
1,2,3,4,5,6,7,8,9,10, 11.
6- Write a program to find the complement of an array of 3 elements from an array of 10
elements. For example: if A[10] = { 1,2,3,4,5,6,7,8,9,10 }and B [3] = {2, 5, 11}, result is
1,3,4,6,7,8,9,10.
Two dimensional array
1- Write a program to read 2-D array from the user of size 3x3, replace all odd numbers by
0, display the positions of odd numbers and the odd number, and display the array after
replacement. For example
2- Write a program that ask user to enter values of two matrices 2x3 and display the
summation and subtraction them.
3- Write a program that accepts two matrices first 2x3 and the second 3x4 and calculate the
multiplication of the two matrices then display result.
4- Write a program to read a matrix (3x3) and ask the user to chose a number and then
display the position of the select number if found, otherwise display “number not found”
5- Write a program to read a matrix (4x4) form the user, ask the user about a specific
column, and swap this column with its next.
6- Write a program to check if a set of numbers can form the magic square or not. The
magic square is a matrix of natural numbers in which the sums of all the rows, columns
are equal, matrix size is 4*4.
7- Bonus: Write a program for X O game, allow two user to play .

More Related Content

What's hot

Matlab on basic mathematics
Matlab on basic mathematicsMatlab on basic mathematics
Matlab on basic mathematics
monauweralam1
 
Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3
Mohamed Awni
 
Operators
OperatorsOperators
Operators
SV.CO
 
Impact of error
Impact of errorImpact of error
Impact of error
Anil Pokhrel
 
Matrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLABMatrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLAB
Abu Raihan Ibna Ali
 
Application's of Numerical Math in CSE
Application's of Numerical Math in CSEApplication's of Numerical Math in CSE
Application's of Numerical Math in CSE
sanjana mun
 
Using Mathematica for computational learning
Using Mathematica for computational learningUsing Mathematica for computational learning
Using Mathematica for computational learning
Miles Ford
 
Substructure Similarity Search in Graph Databases
Substructure Similarity Search in Graph DatabasesSubstructure Similarity Search in Graph Databases
Substructure Similarity Search in Graph Databases
pgst
 
Trigonometric, hyperbolic functions with invers and sum function
Trigonometric, hyperbolic functions with invers and sum functionTrigonometric, hyperbolic functions with invers and sum function
Trigonometric, hyperbolic functions with invers and sum function
DlearAhmad
 
Math
MathMath
NACA Regula Falsi Method
 NACA Regula Falsi Method NACA Regula Falsi Method
NACA Regula Falsi Method
Mujeeb UR Rahman
 
Noisy optimization with nevergrad
Noisy optimization with nevergradNoisy optimization with nevergrad
Noisy optimization with nevergrad
Olivier Teytaud
 
Matrices And Application Of Matrices
Matrices And Application Of MatricesMatrices And Application Of Matrices
Matrices And Application Of Matrices
mailrenuka
 
Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...
licservernoida
 
MATLAB
MATLABMATLAB
Matrix and it's Application
Matrix and it's ApplicationMatrix and it's Application
Matrix and it's Application
Mahmudle Hassan
 
Application of interpolation in CSE
Application of interpolation in CSEApplication of interpolation in CSE
Application of interpolation in CSE
Md. Tanvir Hossain
 
Me 443 1 what is mathematica Erdi Karaçal Mechanical Engineer University of...
Me 443   1 what is mathematica Erdi Karaçal Mechanical Engineer University of...Me 443   1 what is mathematica Erdi Karaçal Mechanical Engineer University of...
Me 443 1 what is mathematica Erdi Karaçal Mechanical Engineer University of...
Erdi Karaçal
 

What's hot (18)

Matlab on basic mathematics
Matlab on basic mathematicsMatlab on basic mathematics
Matlab on basic mathematics
 
Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3Matlab HTI summer training course Lecture3
Matlab HTI summer training course Lecture3
 
Operators
OperatorsOperators
Operators
 
Impact of error
Impact of errorImpact of error
Impact of error
 
Matrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLABMatrices, Arrays and Vectors in MATLAB
Matrices, Arrays and Vectors in MATLAB
 
Application's of Numerical Math in CSE
Application's of Numerical Math in CSEApplication's of Numerical Math in CSE
Application's of Numerical Math in CSE
 
Using Mathematica for computational learning
Using Mathematica for computational learningUsing Mathematica for computational learning
Using Mathematica for computational learning
 
Substructure Similarity Search in Graph Databases
Substructure Similarity Search in Graph DatabasesSubstructure Similarity Search in Graph Databases
Substructure Similarity Search in Graph Databases
 
Trigonometric, hyperbolic functions with invers and sum function
Trigonometric, hyperbolic functions with invers and sum functionTrigonometric, hyperbolic functions with invers and sum function
Trigonometric, hyperbolic functions with invers and sum function
 
Math
MathMath
Math
 
NACA Regula Falsi Method
 NACA Regula Falsi Method NACA Regula Falsi Method
NACA Regula Falsi Method
 
Noisy optimization with nevergrad
Noisy optimization with nevergradNoisy optimization with nevergrad
Noisy optimization with nevergrad
 
Matrices And Application Of Matrices
Matrices And Application Of MatricesMatrices And Application Of Matrices
Matrices And Application Of Matrices
 
Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...Writea program that defines a template function named add(). Thisfunction tak...
Writea program that defines a template function named add(). Thisfunction tak...
 
MATLAB
MATLABMATLAB
MATLAB
 
Matrix and it's Application
Matrix and it's ApplicationMatrix and it's Application
Matrix and it's Application
 
Application of interpolation in CSE
Application of interpolation in CSEApplication of interpolation in CSE
Application of interpolation in CSE
 
Me 443 1 what is mathematica Erdi Karaçal Mechanical Engineer University of...
Me 443   1 what is mathematica Erdi Karaçal Mechanical Engineer University of...Me 443   1 what is mathematica Erdi Karaçal Mechanical Engineer University of...
Me 443 1 what is mathematica Erdi Karaçal Mechanical Engineer University of...
 

Similar to Array sheet

Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments
rajni kaushal
 
CE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfCE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdf
UmarMustafa13
 
Lab exp declaring arrays)
Lab exp declaring arrays)Lab exp declaring arrays)
Lab exp declaring arrays)
Daman Toor
 
Practical java
Practical javaPractical java
Practical java
nirmit
 
Mmt 001
Mmt 001Mmt 001
Mmt 001
sujatam8
 
Lab exam question_paper
Lab exam question_paperLab exam question_paper
Lab exam question_paper
Kuntal Bhowmick
 
Develop a system flowchart and then write a menu-driven C++ program .pdf
Develop a system flowchart and then write a menu-driven C++ program .pdfDevelop a system flowchart and then write a menu-driven C++ program .pdf
Develop a system flowchart and then write a menu-driven C++ program .pdf
leventhalbrad49439
 
Cse cpl manual-2016
Cse cpl manual-2016Cse cpl manual-2016
Cse cpl manual-2016
Rajendra khatana
 
Lab6: I/O and Arrays
Lab6: I/O and ArraysLab6: I/O and Arrays
Lab6: I/O and Arrays
enidcruz
 
C programming exercises and solutions
C programming exercises and solutions C programming exercises and solutions
C programming exercises and solutions
Rumman Ansari
 
Best c programs
Best c programsBest c programs
Best c programs
AbhishekSharma471920
 
Simple c-programs
Simple c-programsSimple c-programs
Simple c-programs
rashmi322
 
Data Structure.pdf
Data Structure.pdfData Structure.pdf
Data Structure.pdf
MemeMiner
 
Prelim Project OOP
Prelim Project OOPPrelim Project OOP
Prelim Project OOP
Dwight Sabio
 
Project management
Project managementProject management
Project management
Avay Minni
 
C programming session 04
C programming session 04C programming session 04
C programming session 04
Dushmanta Nath
 
Lewis jssap3 e_labman02
Lewis jssap3 e_labman02Lewis jssap3 e_labman02
Lewis jssap3 e_labman02
auswhit
 
Programming qns
Programming qnsProgramming qns
Programming qns
Dr.Subha Krishna
 
Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)
IIUM
 
Data Manipulation with Numpy and Pandas in PythonStarting with N
Data Manipulation with Numpy and Pandas in PythonStarting with NData Manipulation with Numpy and Pandas in PythonStarting with N
Data Manipulation with Numpy and Pandas in PythonStarting with N
OllieShoresna
 

Similar to Array sheet (20)

Java programming lab assignments
Java programming lab assignments Java programming lab assignments
Java programming lab assignments
 
CE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdfCE344L-200365-Lab2.pdf
CE344L-200365-Lab2.pdf
 
Lab exp declaring arrays)
Lab exp declaring arrays)Lab exp declaring arrays)
Lab exp declaring arrays)
 
Practical java
Practical javaPractical java
Practical java
 
Mmt 001
Mmt 001Mmt 001
Mmt 001
 
Lab exam question_paper
Lab exam question_paperLab exam question_paper
Lab exam question_paper
 
Develop a system flowchart and then write a menu-driven C++ program .pdf
Develop a system flowchart and then write a menu-driven C++ program .pdfDevelop a system flowchart and then write a menu-driven C++ program .pdf
Develop a system flowchart and then write a menu-driven C++ program .pdf
 
Cse cpl manual-2016
Cse cpl manual-2016Cse cpl manual-2016
Cse cpl manual-2016
 
Lab6: I/O and Arrays
Lab6: I/O and ArraysLab6: I/O and Arrays
Lab6: I/O and Arrays
 
C programming exercises and solutions
C programming exercises and solutions C programming exercises and solutions
C programming exercises and solutions
 
Best c programs
Best c programsBest c programs
Best c programs
 
Simple c-programs
Simple c-programsSimple c-programs
Simple c-programs
 
Data Structure.pdf
Data Structure.pdfData Structure.pdf
Data Structure.pdf
 
Prelim Project OOP
Prelim Project OOPPrelim Project OOP
Prelim Project OOP
 
Project management
Project managementProject management
Project management
 
C programming session 04
C programming session 04C programming session 04
C programming session 04
 
Lewis jssap3 e_labman02
Lewis jssap3 e_labman02Lewis jssap3 e_labman02
Lewis jssap3 e_labman02
 
Programming qns
Programming qnsProgramming qns
Programming qns
 
Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)Tutorial 04 (revised) (1)
Tutorial 04 (revised) (1)
 
Data Manipulation with Numpy and Pandas in PythonStarting with N
Data Manipulation with Numpy and Pandas in PythonStarting with NData Manipulation with Numpy and Pandas in PythonStarting with N
Data Manipulation with Numpy and Pandas in PythonStarting with N
 

Recently uploaded

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
Kavitha Krishnan
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 

Recently uploaded (20)

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Assessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptxAssessment and Planning in Educational technology.pptx
Assessment and Planning in Educational technology.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 

Array sheet

  • 1. October 6 UNI Department of Computer Science Structured Programming Practice Lab (Arrays) One dimensional array 1- Write a C++ program that accepts an array of 20 elements then apply the following operations : A. Reverse the order of the array and display it. B. Display the sum and the average of the array. C. Allow user to input a number and search for this number in the array. 2- Write a program to read 20 values from the user, ask the user about a number N, and display how many numbers of N in this array. 3- Write a program that accepts an array of ten elements and an integer value then find scalar multiplication. 4- Write a program to find the intersection between array of 10 elements and array o3 elements. For example: if A[10] = { 1,2,3,4,5,6,7,8,9,10 }and B [3] = {2, 5, 11}, result is 2, 5. 5- Write a program to find the union between array of 10 elements and array o3 elements. For example: if A[10] = { 1,2,3,4,5,6,7,8,9,10 }and B [3] = {2, 5, 11}, result is 1,2,3,4,5,6,7,8,9,10, 11. 6- Write a program to find the complement of an array of 3 elements from an array of 10 elements. For example: if A[10] = { 1,2,3,4,5,6,7,8,9,10 }and B [3] = {2, 5, 11}, result is 1,3,4,6,7,8,9,10.
  • 2. Two dimensional array 1- Write a program to read 2-D array from the user of size 3x3, replace all odd numbers by 0, display the positions of odd numbers and the odd number, and display the array after replacement. For example 2- Write a program that ask user to enter values of two matrices 2x3 and display the summation and subtraction them. 3- Write a program that accepts two matrices first 2x3 and the second 3x4 and calculate the multiplication of the two matrices then display result. 4- Write a program to read a matrix (3x3) and ask the user to chose a number and then display the position of the select number if found, otherwise display “number not found” 5- Write a program to read a matrix (4x4) form the user, ask the user about a specific column, and swap this column with its next. 6- Write a program to check if a set of numbers can form the magic square or not. The magic square is a matrix of natural numbers in which the sums of all the rows, columns are equal, matrix size is 4*4. 7- Bonus: Write a program for X O game, allow two user to play .