SlideShare a Scribd company logo
1 of 21
QUESTION PATTERN IN STRUCTURE PROGRAMMING
Course No : CSE 0613-101
Course Title : Structure Programming
Suman Saikan
Lecturer
Dept. of CSE
Dhaka International University
1
INTRODUCTION
Definition of Structure Programming Language
Structured Programming is a type of programming that
generally converts large or complex programs into more
manageable and small pieces of code.
2
DISTINGUISH BETWEEN STRUCTURE PROGRAMMING AND OBJECT
ORIENTED PROGRAMMING
3
DESCRIBE DIFFERENT KINDS OF LOOP WITH EXAMPLE
 Loops in programming are used to repeat a block of code until
the specified condition is met. A loop statement allows
programmers to execute a statement or group of statements
multiple times without repetition of code.
4
For Loop
for loop in C programming is a repetition control structure that
allows programmers to write a loop that will be executed a
specific number of times. for loop enables programmers to
perform n number of steps together in a single line.
Syntax:
for (initialize expression; test expression; update
expression)
{
// // body of for loop // ;
}
5
While Loop
While loop does not depend upon the number of iterations.
In for loop the number of iterations was previously known to
us but in the While loop, the execution is terminated on the
basis of the test condition. If the test condition will become
false then it will break from the while loop else body will be
executed.
Syntax:
initialization_expression;
while (test_expression)
{
// body of the while loop
update_expression;
}
6
Do-while Loop
The do-while loop is similar to a while loop but the
only difference lies in the do-while loop test
condition which is tested at the end of the body. In
the do-while loop, the loop body will execute at
least once irrespective of the test condition.
Syntax:
initialization_expression;
do {
// body of do-while loop update_expression;
} while (test_expression);
7
EXPLAIN INFINITE LOOP BY USING FOR LOOP
Infinite Loop
An infinite loop is executed when the test expression never becomes
false and the body of the loop is executed repeatedly. A program is
stuck in an Infinite loop when the condition is always true. Mostly this is
an error that can be resolved by using Loop Control statements.
8
Example of Infinite Loop:
#include <stdio.h>
int main ()
{
int i;
for ( ; ; )
{
printf("This loop will run forever.n");
}
return 0;
}
9
ILLUSTRATE RECURSION IN STRUCTURE PROGRAMMING
Recursion is the technique of making a function call itself. This
technique provides a way to break complicated problems down into
simple problems which are easier to solve.
10
DISTINGUISH BETWEEN POST INCREMENT AND PRE INCREMENT
11
CALL BY VALUE AND CALL BY REFERENCE
12
WHAT IS OPERATOR PRECEDENCE IN C
Operator precedence determines the grouping of terms in an expression and
decides how an expression is evaluated. Certain operators have higher
precedence than others
13
FIND ERROR AND SOLVE IT IN C
Problem:
 #include <stdio,h>
 int main()
 {
 int a=2;
 if(A>1)

 Printf("a is greater than 1")
 return 0;
 }
Solution:
#include <stdio.h>
int main()
{
int a=2;
if(a>1)
printf("a is greater than 1");
return 0;
}
14
EXPLAIN THE OUTPUT OF A C PROGRAM
#include<stdio.h>
int main()
{
int i;
for(i=0;i<10;i++)
{
if(i==5)
break;
}
printf("%d",i);
} 15
SWAP TWO VARIABLE WITHOUT USING THIRD VARIABLE
16
WRITE THE OUTPUT OF THIS FOLLOWING CODE
17
FLOWCHART OF CONDITIONAL STATEMENT
Flowchart of if statement in C
18
Flowchart of the if-else statement in C
19
FLOWCHART OF CONDITIONAL STATEMENT
FLOWCHART OF CONDITIONAL STATEMENT
Flowchart of else-if ladder statement in C
20
21

More Related Content

Similar to Question Pattern in Structure Programming

Similar to Question Pattern in Structure Programming (20)

C loops
C loopsC loops
C loops
 
CMP1001 Loops 1
CMP1001 Loops 1CMP1001 Loops 1
CMP1001 Loops 1
 
LOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptxLOOPING IN C- PROGRAMMING.pptx
LOOPING IN C- PROGRAMMING.pptx
 
Fundamentals of programming
Fundamentals of programmingFundamentals of programming
Fundamentals of programming
 
etlplooping-170320213203.pptx
etlplooping-170320213203.pptxetlplooping-170320213203.pptx
etlplooping-170320213203.pptx
 
Java chapter 5
Java chapter 5Java chapter 5
Java chapter 5
 
Loops in C Programming Language
Loops in C Programming LanguageLoops in C Programming Language
Loops in C Programming Language
 
Chapter 3
Chapter 3Chapter 3
Chapter 3
 
The Loops
The LoopsThe Loops
The Loops
 
C++ programming
C++ programmingC++ programming
C++ programming
 
C++ programming
C++ programmingC++ programming
C++ programming
 
Different loops in C
Different loops in CDifferent loops in C
Different loops in C
 
Final requirement
Final requirementFinal requirement
Final requirement
 
C Language Presentation.pptx
C Language Presentation.pptxC Language Presentation.pptx
C Language Presentation.pptx
 
Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)Final project powerpoint template (fndprg) (1)
Final project powerpoint template (fndprg) (1)
 
Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!Yeahhhh the final requirement!!!
Yeahhhh the final requirement!!!
 
Programming in Arduino (Part 2)
Programming in Arduino  (Part 2)Programming in Arduino  (Part 2)
Programming in Arduino (Part 2)
 
C Programming Unit-2
C Programming Unit-2C Programming Unit-2
C Programming Unit-2
 
Ch3 repetition
Ch3 repetitionCh3 repetition
Ch3 repetition
 
Loops c++
Loops c++Loops c++
Loops c++
 

More from Suman Mia

Computer Network Topology By Team_Initiator (Dept . of Sociology)
Computer Network Topology By Team_Initiator (Dept . of Sociology)Computer Network Topology By Team_Initiator (Dept . of Sociology)
Computer Network Topology By Team_Initiator (Dept . of Sociology)Suman Mia
 
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)Suman Mia
 
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)Suman Mia
 
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)Suman Mia
 
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...Suman Mia
 
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)Suman Mia
 
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)Suman Mia
 
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)Suman Mia
 
Computer Network Topology By Team_Venus(Dept. English)
Computer Network Topology By Team_Venus(Dept. English)Computer Network Topology By Team_Venus(Dept. English)
Computer Network Topology By Team_Venus(Dept. English)Suman Mia
 
Computer Network Topology By Team_Triangle(Dept. English)
Computer Network Topology By Team_Triangle(Dept. English)Computer Network Topology By Team_Triangle(Dept. English)
Computer Network Topology By Team_Triangle(Dept. English)Suman Mia
 
Computer Network Topology By Team_Royal (Dept. English)
Computer Network Topology By Team_Royal (Dept. English)Computer Network Topology By Team_Royal (Dept. English)
Computer Network Topology By Team_Royal (Dept. English)Suman Mia
 
Computer Network Topology By Team_Sanam (Dept. English)
Computer Network Topology By Team_Sanam (Dept. English)Computer Network Topology By Team_Sanam (Dept. English)
Computer Network Topology By Team_Sanam (Dept. English)Suman Mia
 
Computer Network Topology By Team_Purple (Dept. English)
Computer Network Topology By Team_Purple (Dept. English)Computer Network Topology By Team_Purple (Dept. English)
Computer Network Topology By Team_Purple (Dept. English)Suman Mia
 
Computer Network Topology By Team_ Paramount (Dept. English)
Computer Network Topology By Team_ Paramount (Dept. English)Computer Network Topology By Team_ Paramount (Dept. English)
Computer Network Topology By Team_ Paramount (Dept. English)Suman Mia
 
Computer Network Topology By Team_Metrolife(Dept. English)
Computer Network Topology By Team_Metrolife(Dept. English)Computer Network Topology By Team_Metrolife(Dept. English)
Computer Network Topology By Team_Metrolife(Dept. English)Suman Mia
 
Computer Network Topology By Team_Meghna (Dept. English)
Computer Network Topology By Team_Meghna (Dept. English)Computer Network Topology By Team_Meghna (Dept. English)
Computer Network Topology By Team_Meghna (Dept. English)Suman Mia
 
Computer Network Topology By Team_Jamuna (Dept. English)
Computer Network Topology By Team_Jamuna (Dept. English)Computer Network Topology By Team_Jamuna (Dept. English)
Computer Network Topology By Team_Jamuna (Dept. English)Suman Mia
 
Computer Network Topology By Team_CSK (Dept. English)
Computer Network Topology By Team_CSK (Dept. English)Computer Network Topology By Team_CSK (Dept. English)
Computer Network Topology By Team_CSK (Dept. English)Suman Mia
 
COmputer Network Topology By Team Gemini
COmputer Network Topology By Team GeminiCOmputer Network Topology By Team Gemini
COmputer Network Topology By Team GeminiSuman Mia
 
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)Suman Mia
 

More from Suman Mia (20)

Computer Network Topology By Team_Initiator (Dept . of Sociology)
Computer Network Topology By Team_Initiator (Dept . of Sociology)Computer Network Topology By Team_Initiator (Dept . of Sociology)
Computer Network Topology By Team_Initiator (Dept . of Sociology)
 
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
Computer Network Topology By Team_Diversity Detectives (Dept . of Sociology)
 
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
Computer Network Topology By Team_Societal Explorers (Dept . of Sociology)
 
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
Computer Network Topology By Team_Social Dynamic Squad (Dept . of Sociology)
 
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
Computer Network Topology By Team_Inclusion Inquiry Initiative (Dept . of Soc...
 
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
Computer Network Topology By Team_Culture Crusade (Dept . of Sociology)
 
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
Computer Network Topology By Team_Community Connectors (Dept . of Sociology)
 
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
Computer Network Topology By Team_Empowerment Ensemble (Dept . of Sociology)
 
Computer Network Topology By Team_Venus(Dept. English)
Computer Network Topology By Team_Venus(Dept. English)Computer Network Topology By Team_Venus(Dept. English)
Computer Network Topology By Team_Venus(Dept. English)
 
Computer Network Topology By Team_Triangle(Dept. English)
Computer Network Topology By Team_Triangle(Dept. English)Computer Network Topology By Team_Triangle(Dept. English)
Computer Network Topology By Team_Triangle(Dept. English)
 
Computer Network Topology By Team_Royal (Dept. English)
Computer Network Topology By Team_Royal (Dept. English)Computer Network Topology By Team_Royal (Dept. English)
Computer Network Topology By Team_Royal (Dept. English)
 
Computer Network Topology By Team_Sanam (Dept. English)
Computer Network Topology By Team_Sanam (Dept. English)Computer Network Topology By Team_Sanam (Dept. English)
Computer Network Topology By Team_Sanam (Dept. English)
 
Computer Network Topology By Team_Purple (Dept. English)
Computer Network Topology By Team_Purple (Dept. English)Computer Network Topology By Team_Purple (Dept. English)
Computer Network Topology By Team_Purple (Dept. English)
 
Computer Network Topology By Team_ Paramount (Dept. English)
Computer Network Topology By Team_ Paramount (Dept. English)Computer Network Topology By Team_ Paramount (Dept. English)
Computer Network Topology By Team_ Paramount (Dept. English)
 
Computer Network Topology By Team_Metrolife(Dept. English)
Computer Network Topology By Team_Metrolife(Dept. English)Computer Network Topology By Team_Metrolife(Dept. English)
Computer Network Topology By Team_Metrolife(Dept. English)
 
Computer Network Topology By Team_Meghna (Dept. English)
Computer Network Topology By Team_Meghna (Dept. English)Computer Network Topology By Team_Meghna (Dept. English)
Computer Network Topology By Team_Meghna (Dept. English)
 
Computer Network Topology By Team_Jamuna (Dept. English)
Computer Network Topology By Team_Jamuna (Dept. English)Computer Network Topology By Team_Jamuna (Dept. English)
Computer Network Topology By Team_Jamuna (Dept. English)
 
Computer Network Topology By Team_CSK (Dept. English)
Computer Network Topology By Team_CSK (Dept. English)Computer Network Topology By Team_CSK (Dept. English)
Computer Network Topology By Team_CSK (Dept. English)
 
COmputer Network Topology By Team Gemini
COmputer Network Topology By Team GeminiCOmputer Network Topology By Team Gemini
COmputer Network Topology By Team Gemini
 
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
Software Development Life Cycle(SDLC) By Team Hunter (Dept. of Pharmacy)
 

Recently uploaded

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 

Recently uploaded (20)

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 

Question Pattern in Structure Programming

  • 1. QUESTION PATTERN IN STRUCTURE PROGRAMMING Course No : CSE 0613-101 Course Title : Structure Programming Suman Saikan Lecturer Dept. of CSE Dhaka International University 1
  • 2. INTRODUCTION Definition of Structure Programming Language Structured Programming is a type of programming that generally converts large or complex programs into more manageable and small pieces of code. 2
  • 3. DISTINGUISH BETWEEN STRUCTURE PROGRAMMING AND OBJECT ORIENTED PROGRAMMING 3
  • 4. DESCRIBE DIFFERENT KINDS OF LOOP WITH EXAMPLE  Loops in programming are used to repeat a block of code until the specified condition is met. A loop statement allows programmers to execute a statement or group of statements multiple times without repetition of code. 4
  • 5. For Loop for loop in C programming is a repetition control structure that allows programmers to write a loop that will be executed a specific number of times. for loop enables programmers to perform n number of steps together in a single line. Syntax: for (initialize expression; test expression; update expression) { // // body of for loop // ; } 5
  • 6. While Loop While loop does not depend upon the number of iterations. In for loop the number of iterations was previously known to us but in the While loop, the execution is terminated on the basis of the test condition. If the test condition will become false then it will break from the while loop else body will be executed. Syntax: initialization_expression; while (test_expression) { // body of the while loop update_expression; } 6
  • 7. Do-while Loop The do-while loop is similar to a while loop but the only difference lies in the do-while loop test condition which is tested at the end of the body. In the do-while loop, the loop body will execute at least once irrespective of the test condition. Syntax: initialization_expression; do { // body of do-while loop update_expression; } while (test_expression); 7
  • 8. EXPLAIN INFINITE LOOP BY USING FOR LOOP Infinite Loop An infinite loop is executed when the test expression never becomes false and the body of the loop is executed repeatedly. A program is stuck in an Infinite loop when the condition is always true. Mostly this is an error that can be resolved by using Loop Control statements. 8
  • 9. Example of Infinite Loop: #include <stdio.h> int main () { int i; for ( ; ; ) { printf("This loop will run forever.n"); } return 0; } 9
  • 10. ILLUSTRATE RECURSION IN STRUCTURE PROGRAMMING Recursion is the technique of making a function call itself. This technique provides a way to break complicated problems down into simple problems which are easier to solve. 10
  • 11. DISTINGUISH BETWEEN POST INCREMENT AND PRE INCREMENT 11
  • 12. CALL BY VALUE AND CALL BY REFERENCE 12
  • 13. WHAT IS OPERATOR PRECEDENCE IN C Operator precedence determines the grouping of terms in an expression and decides how an expression is evaluated. Certain operators have higher precedence than others 13
  • 14. FIND ERROR AND SOLVE IT IN C Problem:  #include <stdio,h>  int main()  {  int a=2;  if(A>1)   Printf("a is greater than 1")  return 0;  } Solution: #include <stdio.h> int main() { int a=2; if(a>1) printf("a is greater than 1"); return 0; } 14
  • 15. EXPLAIN THE OUTPUT OF A C PROGRAM #include<stdio.h> int main() { int i; for(i=0;i<10;i++) { if(i==5) break; } printf("%d",i); } 15
  • 16. SWAP TWO VARIABLE WITHOUT USING THIRD VARIABLE 16
  • 17. WRITE THE OUTPUT OF THIS FOLLOWING CODE 17
  • 18. FLOWCHART OF CONDITIONAL STATEMENT Flowchart of if statement in C 18
  • 19. Flowchart of the if-else statement in C 19 FLOWCHART OF CONDITIONAL STATEMENT
  • 20. FLOWCHART OF CONDITIONAL STATEMENT Flowchart of else-if ladder statement in C 20
  • 21. 21