SlideShare une entreprise Scribd logo
1  sur  2
How do arrays compare with variables and how do they differ? Give a simple example
(Programming Logic and Design)
Solution
Arrays : Array is a homogeneous (same kind of elements) collection of elements in memory in a
contagious locations.
The first element of array is stored at index =0 and last element is stored at index=size-1.
For example, int marks [5] ={10,20,30,40,50};
10
20
30
40
50
Variable : The variable is a name given to memory location in a computer memory. The element
is stored in that memory location can be pointed by the variable name.
For example, int id=10;
Where id is a name given to the memory location where the value 10 is stored.
Comparison of array elements with variables :
Since arrays are stored index based, the elements are compared using index location of the
element in an array.
int min=50;
for(int i=0;i<5;i++)
//comparison of array element with variable, min
if(marks[index]==min)
//code follows
10 20 30 40 50

Contenu connexe

Similaire à How do arrays compare with variables and how do they differ- Give a si.docx

Similaire à How do arrays compare with variables and how do they differ- Give a si.docx (20)

Data structure array
Data structure  arrayData structure  array
Data structure array
 
Data structure ppt
Data structure pptData structure ppt
Data structure ppt
 
Data structures in c#
Data structures in c#Data structures in c#
Data structures in c#
 
1 D Arrays in C++
1 D Arrays in C++1 D Arrays in C++
1 D Arrays in C++
 
Data structure.pptx
Data structure.pptxData structure.pptx
Data structure.pptx
 
arrays.pptx
arrays.pptxarrays.pptx
arrays.pptx
 
Lecture 15 - Array
Lecture 15 - ArrayLecture 15 - Array
Lecture 15 - Array
 
Array
ArrayArray
Array
 
DSA Unit II array.pptx
DSA Unit II array.pptxDSA Unit II array.pptx
DSA Unit II array.pptx
 
Chapter 13.pptx
Chapter 13.pptxChapter 13.pptx
Chapter 13.pptx
 
Learn Java Part 8
Learn Java Part 8Learn Java Part 8
Learn Java Part 8
 
1st lecture.ppt
1st lecture.ppt1st lecture.ppt
1st lecture.ppt
 
Homework Assignment – Array Technical DocumentWrite a technical .pdf
Homework Assignment – Array Technical DocumentWrite a technical .pdfHomework Assignment – Array Technical DocumentWrite a technical .pdf
Homework Assignment – Array Technical DocumentWrite a technical .pdf
 
C++ arrays part1
C++ arrays part1C++ arrays part1
C++ arrays part1
 
Arrays in JAVA.ppt
Arrays in JAVA.pptArrays in JAVA.ppt
Arrays in JAVA.ppt
 
02 arrays
02 arrays02 arrays
02 arrays
 
DATA STRUCTURE CLASS 12 COMPUTER SCIENCE
DATA STRUCTURE CLASS 12 COMPUTER SCIENCEDATA STRUCTURE CLASS 12 COMPUTER SCIENCE
DATA STRUCTURE CLASS 12 COMPUTER SCIENCE
 
Data Structure.pptx
Data Structure.pptxData Structure.pptx
Data Structure.pptx
 
OOPs with java
OOPs with javaOOPs with java
OOPs with java
 
Aj unit2 notesjavadatastructures
Aj unit2 notesjavadatastructuresAj unit2 notesjavadatastructures
Aj unit2 notesjavadatastructures
 

Plus de tpaula2

How can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxHow can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxtpaula2
 
How can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxHow can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxtpaula2
 
How do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxHow do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxtpaula2
 
How can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxHow can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxtpaula2
 
How can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxHow can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxtpaula2
 
How change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxHow change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxtpaula2
 
How can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxHow can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxtpaula2
 
How are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxHow are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxtpaula2
 
How are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxHow are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxtpaula2
 
How can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxHow can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxtpaula2
 
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxHolmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxtpaula2
 
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxHNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxtpaula2
 
Hi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxHi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxtpaula2
 
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxHi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxtpaula2
 
Hi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxHi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxtpaula2
 
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxHerbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxtpaula2
 
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxHere is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxtpaula2
 
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docxtpaula2
 
1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docxtpaula2
 
1- How did the Roman Catholc church influence music in the Middle Ages.docx
1- How did the Roman Catholc church influence music in the Middle Ages.docx1- How did the Roman Catholc church influence music in the Middle Ages.docx
1- How did the Roman Catholc church influence music in the Middle Ages.docxtpaula2
 

Plus de tpaula2 (20)

How can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docxHow can I calculate the missing amounts for each of the independent ca.docx
How can I calculate the missing amounts for each of the independent ca.docx
 
How can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docxHow can other countries respond to international piracy-Solutiona-) St.docx
How can other countries respond to international piracy-Solutiona-) St.docx
 
How do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docxHow do I block a certain range of IP addresses in a CENTOS server from.docx
How do I block a certain range of IP addresses in a CENTOS server from.docx
 
How can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docxHow can we reduce software requirement errors -SolutionIf we want to r.docx
How can we reduce software requirement errors -SolutionIf we want to r.docx
 
How can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docxHow can the use of Internet search engines to locate information about.docx
How can the use of Internet search engines to locate information about.docx
 
How change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docxHow change in a corporation-'s natural and societal environments can a.docx
How change in a corporation-'s natural and societal environments can a.docx
 
How can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docxHow can you prevent intruders from accessing your wireless network- a).docx
How can you prevent intruders from accessing your wireless network- a).docx
 
How are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docxHow are standing waves similar to beats and how are they different- Ty.docx
How are standing waves similar to beats and how are they different- Ty.docx
 
How are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docxHow are corporate abuse of power corporate fraud- and corporate econom.docx
How are corporate abuse of power corporate fraud- and corporate econom.docx
 
How can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docxHow can biometric technology be used to fight cybercrime and cyber rel.docx
How can biometric technology be used to fight cybercrime and cyber rel.docx
 
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docxHolmes- CPA- assisted Williams Corporation in preparing its financial.docx
Holmes- CPA- assisted Williams Corporation in preparing its financial.docx
 
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docxHNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
HNO2 has a Ka of 4-00x10^-3- What is the pH of a solution prepared by.docx
 
Hi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docxHi- Can you answer this question- Please show all your work and show i.docx
Hi- Can you answer this question- Please show all your work and show i.docx
 
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docxHi! I think the answer is C Outsource the software- I juyst wanted to.docx
Hi! I think the answer is C Outsource the software- I juyst wanted to.docx
 
Hi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docxHi all! someone help me pls Fraud examination I need to write an essay.docx
Hi all! someone help me pls Fraud examination I need to write an essay.docx
 
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docxHerbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
Herbie Corp-'s Balance Sheet showed the following at 12-31-13 Common S.docx
 
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docxHere is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
Here is a list of the main characters in Shakespeare-'s Romeo and Juli.docx
 
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
1- How many ATOMS of sulfur are present in 2-25 moles of sulfur trioxi.docx
 
1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx1- How does having a scope and WBS help project teams during project e.docx
1- How does having a scope and WBS help project teams during project e.docx
 
1- How did the Roman Catholc church influence music in the Middle Ages.docx
1- How did the Roman Catholc church influence music in the Middle Ages.docx1- How did the Roman Catholc church influence music in the Middle Ages.docx
1- How did the Roman Catholc church influence music in the Middle Ages.docx
 

Dernier

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 

Dernier (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 

How do arrays compare with variables and how do they differ- Give a si.docx

  • 1. How do arrays compare with variables and how do they differ? Give a simple example (Programming Logic and Design) Solution Arrays : Array is a homogeneous (same kind of elements) collection of elements in memory in a contagious locations. The first element of array is stored at index =0 and last element is stored at index=size-1. For example, int marks [5] ={10,20,30,40,50}; 10 20 30 40 50 Variable : The variable is a name given to memory location in a computer memory. The element is stored in that memory location can be pointed by the variable name. For example, int id=10; Where id is a name given to the memory location where the value 10 is stored. Comparison of array elements with variables : Since arrays are stored index based, the elements are compared using index location of the element in an array. int min=50;
  • 2. for(int i=0;i<5;i++) //comparison of array element with variable, min if(marks[index]==min) //code follows 10 20 30 40 50