SlideShare uma empresa Scribd logo
1 de 1
7. (10 points) Consider the following code. What is the final value of count? count -0; for a0:2
for b 2:-1:a for c a:b count count1; end end end
Solution
the final value of count is 10
count = 0; % count variable is assigned with value zero
for a=0:2 % the value of a is begin with zero increment by 1 until reach 2
for b=2:-1:a % the value of b is begin with 2 and decrement by 1 till reach the value of a loop
ends
for c= a:b % the value of c is begin with the value in a and increment by one till reach the value
in b .loop ends
count= count+1; %the count variable is incremented by one till loop terimination
fprintf(" a =%d , b= %d ,c= %d ,count = %d  ",a,b,c,count);
end
end
end
fprintf("/n final value of count = %d ",count);
on executing the above program we it displays the following result
Output:

Mais conteúdo relacionado

Semelhante a 7- (10 points) Consider the following code- What is the final value of.docx

C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh AnkitSinghRajput35
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
7 Examples of C Program (Civil Engineering)
7 Examples of C Program (Civil Engineering)7 Examples of C Program (Civil Engineering)
7 Examples of C Program (Civil Engineering)Faisal F Rafat
 
In C Programming create a program that converts a number from decimal.docx
In C Programming create a program that converts a number from decimal.docxIn C Programming create a program that converts a number from decimal.docx
In C Programming create a program that converts a number from decimal.docxtristans3
 
C Operators and Control Structures.pdf
C Operators and Control Structures.pdfC Operators and Control Structures.pdf
C Operators and Control Structures.pdfMaryJacob24
 
Assignment solution-week7
Assignment solution-week7Assignment solution-week7
Assignment solution-week7PUSHPALATHAV1
 
programs of c www.eakanchha.com
 programs of c www.eakanchha.com programs of c www.eakanchha.com
programs of c www.eakanchha.comAkanchha Agrawal
 
An efficient algorithm for the computation of Bernoulli numbers
 An efficient algorithm for the computation of Bernoulli numbers An efficient algorithm for the computation of Bernoulli numbers
An efficient algorithm for the computation of Bernoulli numbersXequeMateShannon
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solutionKuntal Bhowmick
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in cBUBT
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxNithya K
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4Rumman Ansari
 

Semelhante a 7- (10 points) Consider the following code- What is the final value of.docx (20)

C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh C - programming - Ankit Kumar Singh
C - programming - Ankit Kumar Singh
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
7 Examples of C Program (Civil Engineering)
7 Examples of C Program (Civil Engineering)7 Examples of C Program (Civil Engineering)
7 Examples of C Program (Civil Engineering)
 
Arithmetic circuits
Arithmetic circuitsArithmetic circuits
Arithmetic circuits
 
In C Programming create a program that converts a number from decimal.docx
In C Programming create a program that converts a number from decimal.docxIn C Programming create a program that converts a number from decimal.docx
In C Programming create a program that converts a number from decimal.docx
 
Programming egs
Programming egs Programming egs
Programming egs
 
C Operators and Control Structures.pdf
C Operators and Control Structures.pdfC Operators and Control Structures.pdf
C Operators and Control Structures.pdf
 
Assignment solution-week7
Assignment solution-week7Assignment solution-week7
Assignment solution-week7
 
C Programming
C ProgrammingC Programming
C Programming
 
C code examples
C code examplesC code examples
C code examples
 
Lecture 7.pptx
Lecture 7.pptxLecture 7.pptx
Lecture 7.pptx
 
programs of c www.eakanchha.com
 programs of c www.eakanchha.com programs of c www.eakanchha.com
programs of c www.eakanchha.com
 
An efficient algorithm for the computation of Bernoulli numbers
 An efficient algorithm for the computation of Bernoulli numbers An efficient algorithm for the computation of Bernoulli numbers
An efficient algorithm for the computation of Bernoulli numbers
 
C important questions
C important questionsC important questions
C important questions
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solution
 
Chapter 5 Balagurusamy Programming ANSI in c
Chapter 5 Balagurusamy Programming ANSI  in cChapter 5 Balagurusamy Programming ANSI  in c
Chapter 5 Balagurusamy Programming ANSI in c
 
Ch03
Ch03Ch03
Ch03
 
PROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptxPROGRAMMING IN C - Operators.pptx
PROGRAMMING IN C - Operators.pptx
 
C Programming Language Part 4
C Programming Language Part 4C Programming Language Part 4
C Programming Language Part 4
 
PSP LAB MANUAL.pdf
PSP LAB MANUAL.pdfPSP LAB MANUAL.pdf
PSP LAB MANUAL.pdf
 

Mais de rjessie

7- (6) Describe the interference pattern produced by light going throu.docx
7- (6) Describe the interference pattern produced by light going throu.docx7- (6) Describe the interference pattern produced by light going throu.docx
7- (6) Describe the interference pattern produced by light going throu.docxrjessie
 
6-14-2018 1159 PM 60-2-100 Gradeboo -Print Calculator Periodic Table Q.docx
6-14-2018 1159 PM 60-2-100 Gradeboo -Print Calculator Periodic Table Q.docx6-14-2018 1159 PM 60-2-100 Gradeboo -Print Calculator Periodic Table Q.docx
6-14-2018 1159 PM 60-2-100 Gradeboo -Print Calculator Periodic Table Q.docxrjessie
 
802-11 networks are identified by which of the following- A- Security.docx
802-11 networks are identified by which of the following- A- Security.docx802-11 networks are identified by which of the following- A- Security.docx
802-11 networks are identified by which of the following- A- Security.docxrjessie
 
8- Super Mario is attempting to high jump from a pipe on to a set of b.docx
8- Super Mario is attempting to high jump from a pipe on to a set of b.docx8- Super Mario is attempting to high jump from a pipe on to a set of b.docx
8- Super Mario is attempting to high jump from a pipe on to a set of b.docxrjessie
 
8- Multiprocessing with a single core processor is ________________- 9.docx
8- Multiprocessing with a single core processor is ________________- 9.docx8- Multiprocessing with a single core processor is ________________- 9.docx
8- Multiprocessing with a single core processor is ________________- 9.docxrjessie
 
8- Identily cach of the following as a strong acid- a weak acid- a bas.docx
8- Identily cach of the following as a strong acid- a weak acid- a bas.docx8- Identily cach of the following as a strong acid- a weak acid- a bas.docx
8- Identily cach of the following as a strong acid- a weak acid- a bas.docxrjessie
 
8- How will doubling the concentration of H20 in the following reactio.docx
8- How will doubling the concentration of H20 in the following reactio.docx8- How will doubling the concentration of H20 in the following reactio.docx
8- How will doubling the concentration of H20 in the following reactio.docxrjessie
 
73- On January 1- 2010- Lynn Company borrows $2-000-000 from National.docx
73- On January 1- 2010- Lynn Company borrows $2-000-000 from National.docx73- On January 1- 2010- Lynn Company borrows $2-000-000 from National.docx
73- On January 1- 2010- Lynn Company borrows $2-000-000 from National.docxrjessie
 
6- Because most reps access the TAL Distributors database from their m.docx
6- Because most reps access the TAL Distributors database from their m.docx6- Because most reps access the TAL Distributors database from their m.docx
6- Because most reps access the TAL Distributors database from their m.docxrjessie
 
6- An airplane flies 450 km from Raleigh to Washington DC at 500 km-hr.docx
6- An airplane flies 450 km from Raleigh to Washington DC at 500 km-hr.docx6- An airplane flies 450 km from Raleigh to Washington DC at 500 km-hr.docx
6- An airplane flies 450 km from Raleigh to Washington DC at 500 km-hr.docxrjessie
 
6- A 25-kg ball with a radius of 10 cm is submerged held halfway down.docx
6- A 25-kg ball with a radius of 10 cm is submerged held halfway down.docx6- A 25-kg ball with a radius of 10 cm is submerged held halfway down.docx
6- A 25-kg ball with a radius of 10 cm is submerged held halfway down.docxrjessie
 
7- Write a mass action expression for the reaction between marble (CaC.docx
7- Write a mass action expression for the reaction between marble (CaC.docx7- Write a mass action expression for the reaction between marble (CaC.docx
7- Write a mass action expression for the reaction between marble (CaC.docxrjessie
 
7- Flow and stock variables Identify whether each of the following is (1).docx
7- Flow and stock variables Identify whether each of the following is (1).docx7- Flow and stock variables Identify whether each of the following is (1).docx
7- Flow and stock variables Identify whether each of the following is (1).docxrjessie
 
7- Heat is (a) a fluid called caloric- (b) a measure of the average ki.docx
7- Heat is (a) a fluid called caloric- (b) a measure of the average ki.docx7- Heat is (a) a fluid called caloric- (b) a measure of the average ki.docx
7- Heat is (a) a fluid called caloric- (b) a measure of the average ki.docxrjessie
 
7- Flow and stock variables Identify whether each of the following is.docx
7- Flow and stock variables Identify whether each of the following is.docx7- Flow and stock variables Identify whether each of the following is.docx
7- Flow and stock variables Identify whether each of the following is.docxrjessie
 
1)- The total number of ions present in iron (II) carbonate is -- 2)-.docx
1)- The total number of ions present in iron (II) carbonate is --  2)-.docx1)- The total number of ions present in iron (II) carbonate is --  2)-.docx
1)- The total number of ions present in iron (II) carbonate is -- 2)-.docxrjessie
 
1) Which of the following can behave as Bronsted-Lowry bases in aqueou.docx
1) Which of the following can behave as Bronsted-Lowry bases in aqueou.docx1) Which of the following can behave as Bronsted-Lowry bases in aqueou.docx
1) Which of the following can behave as Bronsted-Lowry bases in aqueou.docxrjessie
 
1) The rodent population in a city is currently estimated at 30-000- I.docx
1) The rodent population in a city is currently estimated at 30-000- I.docx1) The rodent population in a city is currently estimated at 30-000- I.docx
1) The rodent population in a city is currently estimated at 30-000- I.docxrjessie
 
1) How is the current ratio calculated- 2) How does a classified balan.docx
1) How is the current ratio calculated- 2) How does a classified balan.docx1) How is the current ratio calculated- 2) How does a classified balan.docx
1) How is the current ratio calculated- 2) How does a classified balan.docxrjessie
 
1) describe the conditions neccesary for a lunar eclipse to occur- and.docx
1) describe the conditions neccesary for a lunar eclipse to occur- and.docx1) describe the conditions neccesary for a lunar eclipse to occur- and.docx
1) describe the conditions neccesary for a lunar eclipse to occur- and.docxrjessie
 

Mais de rjessie (20)

7- (6) Describe the interference pattern produced by light going throu.docx
7- (6) Describe the interference pattern produced by light going throu.docx7- (6) Describe the interference pattern produced by light going throu.docx
7- (6) Describe the interference pattern produced by light going throu.docx
 
6-14-2018 1159 PM 60-2-100 Gradeboo -Print Calculator Periodic Table Q.docx
6-14-2018 1159 PM 60-2-100 Gradeboo -Print Calculator Periodic Table Q.docx6-14-2018 1159 PM 60-2-100 Gradeboo -Print Calculator Periodic Table Q.docx
6-14-2018 1159 PM 60-2-100 Gradeboo -Print Calculator Periodic Table Q.docx
 
802-11 networks are identified by which of the following- A- Security.docx
802-11 networks are identified by which of the following- A- Security.docx802-11 networks are identified by which of the following- A- Security.docx
802-11 networks are identified by which of the following- A- Security.docx
 
8- Super Mario is attempting to high jump from a pipe on to a set of b.docx
8- Super Mario is attempting to high jump from a pipe on to a set of b.docx8- Super Mario is attempting to high jump from a pipe on to a set of b.docx
8- Super Mario is attempting to high jump from a pipe on to a set of b.docx
 
8- Multiprocessing with a single core processor is ________________- 9.docx
8- Multiprocessing with a single core processor is ________________- 9.docx8- Multiprocessing with a single core processor is ________________- 9.docx
8- Multiprocessing with a single core processor is ________________- 9.docx
 
8- Identily cach of the following as a strong acid- a weak acid- a bas.docx
8- Identily cach of the following as a strong acid- a weak acid- a bas.docx8- Identily cach of the following as a strong acid- a weak acid- a bas.docx
8- Identily cach of the following as a strong acid- a weak acid- a bas.docx
 
8- How will doubling the concentration of H20 in the following reactio.docx
8- How will doubling the concentration of H20 in the following reactio.docx8- How will doubling the concentration of H20 in the following reactio.docx
8- How will doubling the concentration of H20 in the following reactio.docx
 
73- On January 1- 2010- Lynn Company borrows $2-000-000 from National.docx
73- On January 1- 2010- Lynn Company borrows $2-000-000 from National.docx73- On January 1- 2010- Lynn Company borrows $2-000-000 from National.docx
73- On January 1- 2010- Lynn Company borrows $2-000-000 from National.docx
 
6- Because most reps access the TAL Distributors database from their m.docx
6- Because most reps access the TAL Distributors database from their m.docx6- Because most reps access the TAL Distributors database from their m.docx
6- Because most reps access the TAL Distributors database from their m.docx
 
6- An airplane flies 450 km from Raleigh to Washington DC at 500 km-hr.docx
6- An airplane flies 450 km from Raleigh to Washington DC at 500 km-hr.docx6- An airplane flies 450 km from Raleigh to Washington DC at 500 km-hr.docx
6- An airplane flies 450 km from Raleigh to Washington DC at 500 km-hr.docx
 
6- A 25-kg ball with a radius of 10 cm is submerged held halfway down.docx
6- A 25-kg ball with a radius of 10 cm is submerged held halfway down.docx6- A 25-kg ball with a radius of 10 cm is submerged held halfway down.docx
6- A 25-kg ball with a radius of 10 cm is submerged held halfway down.docx
 
7- Write a mass action expression for the reaction between marble (CaC.docx
7- Write a mass action expression for the reaction between marble (CaC.docx7- Write a mass action expression for the reaction between marble (CaC.docx
7- Write a mass action expression for the reaction between marble (CaC.docx
 
7- Flow and stock variables Identify whether each of the following is (1).docx
7- Flow and stock variables Identify whether each of the following is (1).docx7- Flow and stock variables Identify whether each of the following is (1).docx
7- Flow and stock variables Identify whether each of the following is (1).docx
 
7- Heat is (a) a fluid called caloric- (b) a measure of the average ki.docx
7- Heat is (a) a fluid called caloric- (b) a measure of the average ki.docx7- Heat is (a) a fluid called caloric- (b) a measure of the average ki.docx
7- Heat is (a) a fluid called caloric- (b) a measure of the average ki.docx
 
7- Flow and stock variables Identify whether each of the following is.docx
7- Flow and stock variables Identify whether each of the following is.docx7- Flow and stock variables Identify whether each of the following is.docx
7- Flow and stock variables Identify whether each of the following is.docx
 
1)- The total number of ions present in iron (II) carbonate is -- 2)-.docx
1)- The total number of ions present in iron (II) carbonate is --  2)-.docx1)- The total number of ions present in iron (II) carbonate is --  2)-.docx
1)- The total number of ions present in iron (II) carbonate is -- 2)-.docx
 
1) Which of the following can behave as Bronsted-Lowry bases in aqueou.docx
1) Which of the following can behave as Bronsted-Lowry bases in aqueou.docx1) Which of the following can behave as Bronsted-Lowry bases in aqueou.docx
1) Which of the following can behave as Bronsted-Lowry bases in aqueou.docx
 
1) The rodent population in a city is currently estimated at 30-000- I.docx
1) The rodent population in a city is currently estimated at 30-000- I.docx1) The rodent population in a city is currently estimated at 30-000- I.docx
1) The rodent population in a city is currently estimated at 30-000- I.docx
 
1) How is the current ratio calculated- 2) How does a classified balan.docx
1) How is the current ratio calculated- 2) How does a classified balan.docx1) How is the current ratio calculated- 2) How does a classified balan.docx
1) How is the current ratio calculated- 2) How does a classified balan.docx
 
1) describe the conditions neccesary for a lunar eclipse to occur- and.docx
1) describe the conditions neccesary for a lunar eclipse to occur- and.docx1) describe the conditions neccesary for a lunar eclipse to occur- and.docx
1) describe the conditions neccesary for a lunar eclipse to occur- and.docx
 

Último

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
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
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 

Último (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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"
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
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"
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
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
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

7- (10 points) Consider the following code- What is the final value of.docx

  • 1. 7. (10 points) Consider the following code. What is the final value of count? count -0; for a0:2 for b 2:-1:a for c a:b count count1; end end end Solution the final value of count is 10 count = 0; % count variable is assigned with value zero for a=0:2 % the value of a is begin with zero increment by 1 until reach 2 for b=2:-1:a % the value of b is begin with 2 and decrement by 1 till reach the value of a loop ends for c= a:b % the value of c is begin with the value in a and increment by one till reach the value in b .loop ends count= count+1; %the count variable is incremented by one till loop terimination fprintf(" a =%d , b= %d ,c= %d ,count = %d ",a,b,c,count); end end end fprintf("/n final value of count = %d ",count); on executing the above program we it displays the following result Output: