left0UNIVERSITI TUN HUSSEIN ONN MALAYSIA<br />FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING <br />BTI 1022: COMPUTER PROGRAMMING<br />LAB EXERCISE 7 LOOP DESIGN<br />Study the design below<br />For Loopfor (int i = 1; i <= n; i++){   double interest = balance * rate / 100;   balance = balance + interest;}While Loop<br />Exercise 1:<br />Draw a flow chart for:<br />for (int item=0;item<7;item++){<br />    printf(\"
\n Enter price of item: RM\"
);<br />    scanf(\"
%lf\"
, &price);<br />    totalprice +=price;<br />}<br />Exercise 2:<br />Draw a flow chart for:<br />int bil, nilai = 3;<br />for (bil = 5; bil >0; bil--){    <br />         if( bil % 2 == 1)<br />               printf(\"
\n %d\"
, bil + nilai); <br />   }<br />Exercise 3:<br />Draw a flow chart for:<br />int x = 1;  <br /> while ( x < 10 ) { <br /> printf( \"
%d\n\"
, x );<br />}<br />Exercise 4:<br />Draw a flow chart for:<br />int row,space,star;<br />for(row=1;row<=9;row++)<br />{                     <br />      for(space=8;space>=row;space--)<br />    {<br />       printf(\"
%c\"
,288); };<br />           for (star=1;star<row;star++)<br />       {<br />        printf(\"
* \"
);  }<br />                       <br />printf(\"
\n\"
);}<br />
Bti1022 lab sheet 8

More Related Content

PDF
Lecture 8 increment_and_decrement_operators
PDF
Arithmetic instructions
DOCX
Bti1022 lab sheet 8
DOCX
Bti1022 lab sheet 9 10
DOCX
Quiz 10 cp_sol
DOCX
Answers+of+C+sample+exam.docx
PPT
Core 3 Functions 2
Lecture 8 increment_and_decrement_operators
Arithmetic instructions
Bti1022 lab sheet 8
Bti1022 lab sheet 9 10
Quiz 10 cp_sol
Answers+of+C+sample+exam.docx
Core 3 Functions 2

What's hot (14)

PDF
Factorial Program in C
DOCX
1 (1)
PDF
Bcsl 033 data and file structures lab s2-2
PDF
C- Programming Assignment 3
PDF
C- Programming Assignment practice set 2 solutions
PPTX
PC 1 continuity
PDF
C- Programming Assignment 4 solution
PPTX
Operator in c
DOCX
New microsoft office word document (2)
PPTX
Operations research
PPTX
MCM FUNCTIONS BLACKBOARD COMPATIBILITY
PPTX
BB - Functions (Operations and Piecewise)
DOCX
Write a program to print out all armstrong numbers between 1 and 500
PDF
Code quailty metrics demystified
Factorial Program in C
1 (1)
Bcsl 033 data and file structures lab s2-2
C- Programming Assignment 3
C- Programming Assignment practice set 2 solutions
PC 1 continuity
C- Programming Assignment 4 solution
Operator in c
New microsoft office word document (2)
Operations research
MCM FUNCTIONS BLACKBOARD COMPATIBILITY
BB - Functions (Operations and Piecewise)
Write a program to print out all armstrong numbers between 1 and 500
Code quailty metrics demystified
Ad

Similar to Bti1022 lab sheet 8 (20)

DOCX
Bti1022 lab sheet 8
PDF
Flowcharts. Algorithms and pseudo codepdf
PDF
ALGORITHMS AND FLOWCHARTS
PDF
PDF
Lesson 1 - Algorithm and Flowcharting.pdf
PPTX
Psuedocode1, algorithm1, Flowchart1.pptx
PDF
Logika dan Algoritma pemrograman
PPT
3 algorithm-and-flowchart
PPT
Pseudocode algorithim flowchart
PDF
DSA Lesson 2 - Algorithm and Flowcharting.pdf
PPT
our c prog work
PPT
Unit 3 Foc
PPTX
Flowcharts
PPTX
Flowcharting
PDF
Software Verification, Validation and Testing
PPTX
Introduction to basic programming repetition
PPTX
flowchart & algorithms
PDF
Optimization Techniques
PPTX
Programming process and flowchart
PPT
Unit 1 psp
Bti1022 lab sheet 8
Flowcharts. Algorithms and pseudo codepdf
ALGORITHMS AND FLOWCHARTS
Lesson 1 - Algorithm and Flowcharting.pdf
Psuedocode1, algorithm1, Flowchart1.pptx
Logika dan Algoritma pemrograman
3 algorithm-and-flowchart
Pseudocode algorithim flowchart
DSA Lesson 2 - Algorithm and Flowcharting.pdf
our c prog work
Unit 3 Foc
Flowcharts
Flowcharting
Software Verification, Validation and Testing
Introduction to basic programming repetition
flowchart & algorithms
Optimization Techniques
Programming process and flowchart
Unit 1 psp
Ad

More from alish sha (20)

PPTX
T22016 – how to answer with ubs 9
PPTX
July 2014 theory exam (theory)
PPTX
Accounting basic equation
PPTX
It 302 computerized accounting (week 2) - sharifah
PPTX
It 302 computerized accounting (week 1) - sharifah
PPTX
What are the causes of conflicts (Bahasa Malaysia)
DOC
Lab 9 sem ii_12_13
DOCX
Lab 10 sem ii_12_13
DOC
Lab 6
DOC
Lab 5 2012/2012
DOCX
Purpose elaborate
DOC
Lab sheet 1
DOC
Test 1 alish schema 1
DOC
Lab 6 sem ii_11_12
PDF
Test 1 skema q&a
PDF
Test 1 skema q&a
DOC
Final project
DOCX
Final project
XLS
Attn list test
PDF
Carry markdam31303
T22016 – how to answer with ubs 9
July 2014 theory exam (theory)
Accounting basic equation
It 302 computerized accounting (week 2) - sharifah
It 302 computerized accounting (week 1) - sharifah
What are the causes of conflicts (Bahasa Malaysia)
Lab 9 sem ii_12_13
Lab 10 sem ii_12_13
Lab 6
Lab 5 2012/2012
Purpose elaborate
Lab sheet 1
Test 1 alish schema 1
Lab 6 sem ii_11_12
Test 1 skema q&a
Test 1 skema q&a
Final project
Final project
Attn list test
Carry markdam31303

Recently uploaded (20)

PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PPTX
Microsoft Excel 365/2024 Beginner's training
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPT
Geologic Time for studying geology for geologist
PDF
Architecture types and enterprise applications.pdf
PDF
OpenACC and Open Hackathons Monthly Highlights July 2025
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
Developing a website for English-speaking practice to English as a foreign la...
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PPTX
TEXTILE technology diploma scope and career opportunities
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
PDF
Five Habits of High-Impact Board Members
PPTX
Modernising the Digital Integration Hub
PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Flame analysis and combustion estimation using large language and vision assi...
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Final SEM Unit 1 for mit wpu at pune .pptx
Microsoft Excel 365/2024 Beginner's training
NewMind AI Weekly Chronicles – August ’25 Week III
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Geologic Time for studying geology for geologist
Architecture types and enterprise applications.pdf
OpenACC and Open Hackathons Monthly Highlights July 2025
A proposed approach for plagiarism detection in Myanmar Unicode text
Developing a website for English-speaking practice to English as a foreign la...
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
TEXTILE technology diploma scope and career opportunities
Getting started with AI Agents and Multi-Agent Systems
GROUP4NURSINGINFORMATICSREPORT-2 PRESENTATION
Five Habits of High-Impact Board Members
Modernising the Digital Integration Hub
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
A review of recent deep learning applications in wood surface defect identifi...
A contest of sentiment analysis: k-nearest neighbor versus neural network
Flame analysis and combustion estimation using large language and vision assi...

Bti1022 lab sheet 8

  • 1. left0UNIVERSITI TUN HUSSEIN ONN MALAYSIA<br />FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING <br />BTI 1022: COMPUTER PROGRAMMING<br />LAB EXERCISE 7 LOOP DESIGN<br />Study the design below<br />For Loopfor (int i = 1; i <= n; i++){   double interest = balance * rate / 100;   balance = balance + interest;}While Loop<br />Exercise 1:<br />Draw a flow chart for:<br />for (int item=0;item<7;item++){<br /> printf(\" \n Enter price of item: RM\" );<br /> scanf(\" %lf\" , &price);<br /> totalprice +=price;<br />}<br />Exercise 2:<br />Draw a flow chart for:<br />int bil, nilai = 3;<br />for (bil = 5; bil >0; bil--){ <br /> if( bil % 2 == 1)<br /> printf(\" \n %d\" , bil + nilai); <br /> }<br />Exercise 3:<br />Draw a flow chart for:<br />int x = 1; <br /> while ( x < 10 ) { <br /> printf( \" %d\n\" , x );<br />}<br />Exercise 4:<br />Draw a flow chart for:<br />int row,space,star;<br />for(row=1;row<=9;row++)<br />{ <br /> for(space=8;space>=row;space--)<br /> {<br /> printf(\" %c\" ,288); };<br /> for (star=1;star<row;star++)<br /> {<br /> printf(\" * \" ); }<br /> <br />printf(\" \n\" );}<br />