SlideShare ist ein Scribd-Unternehmen logo
1 von 3
left0UNIVERSITI TUN HUSSEIN ONN MALAYSIA<br />FACULTY OF MECHANICAL AND MANUFACTURING ENGINEERING <br />DAM 31303/DTI 2143: COMPUTER PROGRAMMING<br />LAB EXERCISE 7  FUNCTION INTRO AND SWITCH CASE RECAPLAB EXERCISE 7  FUNCTION INTRO AND SWITCH CASE RECAP<br />Exercise 1.0:  Type in the following program<br />#include<stdio.h><br />#include<conio.h><br />int fnAdd(int iNum1, int iNum2) ;<br />int main(int argc, char **argv) {<br />int iResult,iValue1=8, iValue2=9;<br />iResult = fnAdd(iValue1, iValue2);<br /> printf(quot;
Sum of %d and %d is %dquot;
,iValue1, iValue2, iResult);<br />getch();<br />    return 0;}<br />int fnAdd(int iNum1, int iNum2)<br />{<br /> int iSum;<br /> iSum = iNum1 + iNum2; <br /> return (iSum);}<br />1.1 Study program 3.0 carefully, then compile and execute it.<br />,[object Object]
Explain how the coding works.
How many arguments passed from function to main program?Exercise 2.0: Type in the following program<br />#include <stdio.h><br />#include <conio.h><br />void fnSum();<br />int main( int argc, char **argv ) {<br />fnSum();<br />getch();<br />    return 0;<br />}<br />void fnSum() {<br />int iNum1,iNum2,iSum;<br />printf(quot;
Enter the two numbers:quot;
);<br />scanf(quot;
%d%dquot;
,&iNum1,&iNum2);<br />iSum = iNum1 + iNum2;<br />printf(quot;
The sum is %dquot;
,iSum);<br />}<br />2.1 Study program 4.0 carefully, then compile and execute it.<br />,[object Object]

Weitere ähnliche Inhalte

Was ist angesagt? (20)

Loop Statements [5] M
Loop Statements [5] MLoop Statements [5] M
Loop Statements [5] M
 
C Language Programs
C Language Programs C Language Programs
C Language Programs
 
Lecture 3 c++
Lecture 3 c++Lecture 3 c++
Lecture 3 c++
 
Recursion
RecursionRecursion
Recursion
 
Prefix Postfix
Prefix PostfixPrefix Postfix
Prefix Postfix
 
Lab 2
Lab 2Lab 2
Lab 2
 
Dti2143 lab sheet 6
Dti2143 lab sheet 6Dti2143 lab sheet 6
Dti2143 lab sheet 6
 
C Programming Example
C Programming Example C Programming Example
C Programming Example
 
comp1
comp1comp1
comp1
 
comp2
comp2comp2
comp2
 
Activities on Operands
Activities on OperandsActivities on Operands
Activities on Operands
 
C Programming Example
C Programming ExampleC Programming Example
C Programming Example
 
Plsql programs
Plsql programsPlsql programs
Plsql programs
 
How c program execute in c program
How c program execute in c program How c program execute in c program
How c program execute in c program
 
Computer Architecture and Organization lab with matlab
Computer Architecture and Organization lab with matlabComputer Architecture and Organization lab with matlab
Computer Architecture and Organization lab with matlab
 
ICP - Lecture 5
ICP - Lecture 5ICP - Lecture 5
ICP - Lecture 5
 
Labsheet_3
Labsheet_3Labsheet_3
Labsheet_3
 
Ankita sharma focp
Ankita sharma focpAnkita sharma focp
Ankita sharma focp
 
First c program
First c programFirst c program
First c program
 
C language operators
C language operatorsC language operators
C language operators
 

Andere mochten auch

Ance_D'Annibale_24052011
Ance_D'Annibale_24052011Ance_D'Annibale_24052011
Ance_D'Annibale_24052011Rèdais
 
Lengua y lenguaje
Lengua y lenguajeLengua y lenguaje
Lengua y lenguajegzit11
 
Crescita solutions advertised
Crescita solutions advertisedCrescita solutions advertised
Crescita solutions advertisedcrescitasolutions
 
愛知中小企業家同友会It研究会
愛知中小企業家同友会It研究会愛知中小企業家同友会It研究会
愛知中小企業家同友会It研究会新一 佐藤
 
Revealing 8 Ways You Could Earn Money With Trevo
Revealing 8 Ways You Could Earn Money With TrevoRevealing 8 Ways You Could Earn Money With Trevo
Revealing 8 Ways You Could Earn Money With TrevoJohn Kennedy Akotia
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13alish sha
 
Cuestions xenetica molecular_e_acidos_nucleicos
Cuestions xenetica molecular_e_acidos_nucleicosCuestions xenetica molecular_e_acidos_nucleicos
Cuestions xenetica molecular_e_acidos_nucleicosjuanapardo
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&aalish sha
 
Meiose 2010 2011 new
Meiose 2010 2011 newMeiose 2010 2011 new
Meiose 2010 2011 newjuanapardo
 
Components of a computer
Components of a computerComponents of a computer
Components of a computerTechTeacher803
 
Ance_Gallesio_24052011
Ance_Gallesio_24052011Ance_Gallesio_24052011
Ance_Gallesio_24052011Rèdais
 
โครงงานครั้งที่........
โครงงานครั้งที่........โครงงานครั้งที่........
โครงงานครั้งที่........NattAA
 

Andere mochten auch (20)

Ance_D'Annibale_24052011
Ance_D'Annibale_24052011Ance_D'Annibale_24052011
Ance_D'Annibale_24052011
 
A
AA
A
 
ΠΑΡΟΥΣΙΑΣΗ ECOMOBILITY 2014
ΠΑΡΟΥΣΙΑΣΗ  ECOMOBILITY  2014ΠΑΡΟΥΣΙΑΣΗ  ECOMOBILITY  2014
ΠΑΡΟΥΣΙΑΣΗ ECOMOBILITY 2014
 
18 xenoma 1
18 xenoma 118 xenoma 1
18 xenoma 1
 
Lengua y lenguaje
Lengua y lenguajeLengua y lenguaje
Lengua y lenguaje
 
All about me
All about meAll about me
All about me
 
Crescita solutions advertised
Crescita solutions advertisedCrescita solutions advertised
Crescita solutions advertised
 
愛知中小企業家同友会It研究会
愛知中小企業家同友会It研究会愛知中小企業家同友会It研究会
愛知中小企業家同友会It研究会
 
Revealing 8 Ways You Could Earn Money With Trevo
Revealing 8 Ways You Could Earn Money With TrevoRevealing 8 Ways You Could Earn Money With Trevo
Revealing 8 Ways You Could Earn Money With Trevo
 
Lab 10 sem ii_12_13
Lab 10 sem ii_12_13Lab 10 sem ii_12_13
Lab 10 sem ii_12_13
 
Ruu ap final (2010)
Ruu ap   final (2010)Ruu ap   final (2010)
Ruu ap final (2010)
 
Cuestions xenetica molecular_e_acidos_nucleicos
Cuestions xenetica molecular_e_acidos_nucleicosCuestions xenetica molecular_e_acidos_nucleicos
Cuestions xenetica molecular_e_acidos_nucleicos
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&a
 
Meiose 2010 2011 new
Meiose 2010 2011 newMeiose 2010 2011 new
Meiose 2010 2011 new
 
Awsをつかってみた
AwsをつかってみたAwsをつかってみた
Awsをつかってみた
 
Indonesia JCM
Indonesia JCM Indonesia JCM
Indonesia JCM
 
Components of a computer
Components of a computerComponents of a computer
Components of a computer
 
Ance_Gallesio_24052011
Ance_Gallesio_24052011Ance_Gallesio_24052011
Ance_Gallesio_24052011
 
โครงงานครั้งที่........
โครงงานครั้งที่........โครงงานครั้งที่........
โครงงานครั้งที่........
 
Rpo4 consultants
Rpo4 consultantsRpo4 consultants
Rpo4 consultants
 

Ähnlich wie Dam31303 dti2143 lab sheet 7

Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9alish sha
 
Bti1022 lab sheet 3
Bti1022 lab sheet 3Bti1022 lab sheet 3
Bti1022 lab sheet 3alish sha
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solutionKuntal Bhowmick
 
Core programming in c
Core programming in cCore programming in c
Core programming in cRahul Pandit
 
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
 
Bti1022 lab sheet 7
Bti1022 lab sheet 7Bti1022 lab sheet 7
Bti1022 lab sheet 7alish sha
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans incnayakq
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programsPrasadu Peddi
 
Dti2143 lab sheet 8
Dti2143 lab sheet 8Dti2143 lab sheet 8
Dti2143 lab sheet 8alish sha
 
Best C Programming Solution
Best C Programming SolutionBest C Programming Solution
Best C Programming Solutionyogini sharma
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.Haard Shah
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 SolutionHazrat Bilal
 
Compiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax DefinitionCompiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax DefinitionEelco Visser
 
Control structure of c
Control structure of cControl structure of c
Control structure of cKomal Kotak
 

Ähnlich wie Dam31303 dti2143 lab sheet 7 (20)

Dti2143 lab sheet 9
Dti2143 lab sheet 9Dti2143 lab sheet 9
Dti2143 lab sheet 9
 
Bti1022 lab sheet 3
Bti1022 lab sheet 3Bti1022 lab sheet 3
Bti1022 lab sheet 3
 
Cs291 assignment solution
Cs291 assignment solutionCs291 assignment solution
Cs291 assignment solution
 
UNIT-II CP DOC.docx
UNIT-II CP DOC.docxUNIT-II CP DOC.docx
UNIT-II CP DOC.docx
 
Core programming in c
Core programming in cCore programming in c
Core programming in c
 
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
 
Bti1022 lab sheet 7
Bti1022 lab sheet 7Bti1022 lab sheet 7
Bti1022 lab sheet 7
 
Qust & ans inc
Qust & ans incQust & ans inc
Qust & ans inc
 
Functions
FunctionsFunctions
Functions
 
C file
C fileC file
C file
 
B.Com 1year Lab programs
B.Com 1year Lab programsB.Com 1year Lab programs
B.Com 1year Lab programs
 
Muzzammilrashid
MuzzammilrashidMuzzammilrashid
Muzzammilrashid
 
Dti2143 lab sheet 8
Dti2143 lab sheet 8Dti2143 lab sheet 8
Dti2143 lab sheet 8
 
Best C Programming Solution
Best C Programming SolutionBest C Programming Solution
Best C Programming Solution
 
C decision making and looping.
C decision making and looping.C decision making and looping.
C decision making and looping.
 
C PROGRAMS
C PROGRAMSC PROGRAMS
C PROGRAMS
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
 
Compiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax DefinitionCompiler Construction | Lecture 2 | Declarative Syntax Definition
Compiler Construction | Lecture 2 | Declarative Syntax Definition
 
Programming egs
Programming egs Programming egs
Programming egs
 
Control structure of c
Control structure of cControl structure of c
Control structure of c
 

Mehr von alish sha

T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9T22016 – how to answer with ubs 9
T22016 – how to answer with ubs 9alish sha
 
July 2014 theory exam (theory)
July 2014 theory exam (theory)July 2014 theory exam (theory)
July 2014 theory exam (theory)alish sha
 
Accounting basic equation
Accounting basic equation Accounting basic equation
Accounting basic equation alish sha
 
It 302 computerized accounting (week 2) - sharifah
It 302   computerized accounting (week 2) - sharifahIt 302   computerized accounting (week 2) - sharifah
It 302 computerized accounting (week 2) - sharifahalish sha
 
It 302 computerized accounting (week 1) - sharifah
It 302   computerized accounting (week 1) - sharifahIt 302   computerized accounting (week 1) - sharifah
It 302 computerized accounting (week 1) - sharifahalish sha
 
What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)What are the causes of conflicts (Bahasa Malaysia)
What are the causes of conflicts (Bahasa Malaysia)alish sha
 
Lab 9 sem ii_12_13
Lab 9 sem ii_12_13Lab 9 sem ii_12_13
Lab 9 sem ii_12_13alish sha
 
Lab 5 2012/2012
Lab 5 2012/2012Lab 5 2012/2012
Lab 5 2012/2012alish sha
 
Purpose elaborate
Purpose elaboratePurpose elaborate
Purpose elaboratealish sha
 
Test 1 alish schema 1
Test 1 alish schema 1Test 1 alish schema 1
Test 1 alish schema 1alish sha
 
Lab 6 sem ii_11_12
Lab 6 sem ii_11_12Lab 6 sem ii_11_12
Lab 6 sem ii_11_12alish sha
 
Test 1 skema q&a
Test 1 skema q&aTest 1 skema q&a
Test 1 skema q&aalish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Attn list test
Attn list testAttn list test
Attn list testalish sha
 
Carry markdam31303
Carry markdam31303Carry markdam31303
Carry markdam31303alish sha
 
Final project
Final projectFinal project
Final projectalish sha
 
Final project
Final projectFinal project
Final projectalish sha
 

Mehr von alish sha (20)

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

Kürzlich hochgeladen

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 

Kürzlich hochgeladen (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Dam31303 dti2143 lab sheet 7

  • 1.
  • 2. Explain how the coding works.
  • 3.
  • 4. Explain how the coding works.
  • 5. How many arguments passed from function to main program?
  • 6.
  • 7. What does the program do?
  • 8. Explain how the coding works.
  • 9.
  • 10. Modify the switch case to if else selectionExercise 5.0: Write a C program to compute bill payment of electrical consumption for different users. In order to promote saving, Tenaga National Berhad (TNB) charge a lower rate to users with lower consumption as shown in table below. Hint:Break down to basic: Input; Switch; If-Else; calculations; While or Do-while loop. The program calculation and output similar as follows:<br />User CodeUser typeFirst RateSecond rate1HouseholdRM0.10 for first 500 unitRM 0.25 for the following units2OfficeRM 0.25 for first 1000 unitRM0.50 for the following units3FactoryRM 0.50 for first 1500 unitRM 0.75 for the following units <br />