SlideShare a Scribd company logo
1 of 25
CONVERTER
C- Language Program


Presented to:

Miss Farah Nawaz
Computer Science Department
Newports Institute of Communication and Economics


Presented by:
Muhammad Shoaib
Zuhaib Ali



Coerce :
Programming Techniques 1
Fall 2013
CONVERTER


We have created a program “converter”.



The program is written in C Language.



That can converter Temperature, Time and Length.
MAIN MENU OF PROGRAM
PROGRAMMING
Converter (C - Language Program)
HEADER FILES


Only one header file is used in our program
SWITCH CASE


We have used a “Switch Case” in this program. And
give 4 cases.



Switch Case


Case 1 - Temperature



Case 2 - Time



Case 3 - Length



Case 4 - Exit
IF FUNCTION


In first 3 case we used
“If function”.



Temperature
 If Celsius
 Else if Fahrenheit
 Else if Kelvin

Time
 If Day
 Else if Hour
 Else if Minute
 Else if Second
 Length
 If Centimeter
 Else if Foot
 Else if Inch
 Else if Meter

CUSTOM FUNCTION


We have created 11 custom functions in our program.



Temperature






Time







Celsius to all
Fahrenheit to all
Kelvin to all

Day to all
Hour to all
Minute to all
Second to all

Length
Centimeter to all
 Foot to all
 Inch to all
 Meter to all

EXAMPLE OF CUSTOM FUNCTION
CelsiusToAll()
{
float Celsius,Fahrenheit,Kelvin;
clrscr();
printf("Enter Temperature in Celsius: ");
scanf("%f",&Celsius);
Fahrenheit=(1.8*Celsius)+32;
Kelvin=(Celsius+273.15);
printf("nTemperature in Fahrenheit : %.3f", Fahrenheit);
printf("nTemperature in Kelvin : %.3fn", Kelvin);
system("pause");
return 0;
}
FLOW CHART OF PROGRAM
TEMPERATURE
UNITS


In “Temperature Conversation” we have given 3
units.
Celsius
 Fahrenheit
 Kelvin

FORMULAS


The formulas used for temperature conversations in
this program are:
From
Temperature
Fahrenheit

Kelvin

Celsius
To

Celsius
=

(Fahrenheit-32)/1.8

Kelvin-273.15

Fahrenheit

Celsius*1.8

=

(Kelvin*1.8)-459.67

Kelvin

Celsius+273.15

(Fahrenheit+459.67)/1.8

=
RESULT
After selecting the input unit program the program
ask to enter temperature in selected unit and
calculate the result in other units and print it.
 Example:

TIME
UNITS


In “Time Conversation” we have given 4 units.
Days
 Hours
 Minutes
 Seconds

FORMULAS


The formulas used for time conversations in this
program are
From
Time
Hours

Minutes

Seconds

Days

=

Hours/24

Minutes/60/24

Seconds/60/60/24

Hours

Days*24

=

Minutes/60

Seconds/60/60

Minutes

Days*24*60

Hours*60

=

Seconds/60

Seconds

Days*24*60*60

Hours*60*60

Minutes*60

=

To

Days
RESULT
After selecting the input unit program the program
ask to enter time in selected unit and calculate the
result in other units and print it.
 Example:

LENGTH
UNITS


In “Length Conversation” we have given 4 units.
Centimeter
 Foot
 Inch
 Meter

FORMULAS


The formulas used for Length conversations in this
program are:
From
Length
Foot

Inch

Meter

Centimet
er

=

Foot*30.48

Inch/0.3937

Meter*100

Foot

Centimeter*0.033

=

Inch/12

Meter/0.3048

Inch

Centimeter*0.398

Foot*12

=

Meter/0.0254

Meter

Centimeter*100

Foot*0.3048

Inch/39.37

=

To

Centimeter
RESULT
After selecting the input unit program the program
ask to enter Length in selected unit and calculate
the result in other units and print it.
 Example:

PENFLIX
THANK YOU

More Related Content

What's hot

Final project report
Final project reportFinal project report
Final project report
ssuryawanshi
 

What's hot (20)

C programming presentation for university
C programming presentation for universityC programming presentation for university
C programming presentation for university
 
Introduction to systems programming
Introduction to systems programmingIntroduction to systems programming
Introduction to systems programming
 
Currency converter
Currency converterCurrency converter
Currency converter
 
Final project report
Final project reportFinal project report
Final project report
 
Final year project presentation in android application
Final year project presentation in android applicationFinal year project presentation in android application
Final year project presentation in android application
 
Language processing activity
Language processing activityLanguage processing activity
Language processing activity
 
Snake game powerpoint presentation by rohit malav
Snake game powerpoint presentation by rohit malavSnake game powerpoint presentation by rohit malav
Snake game powerpoint presentation by rohit malav
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Chap 01-1 jwfiles
Chap 01-1 jwfilesChap 01-1 jwfiles
Chap 01-1 jwfiles
 
Functions in C
Functions in CFunctions in C
Functions in C
 
358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1358 33 powerpoint-slides_1-introduction-c_chapter-1
358 33 powerpoint-slides_1-introduction-c_chapter-1
 
CSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android ApplicationCSE Final Year Project Presentation on Android Application
CSE Final Year Project Presentation on Android Application
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
Multimedia on android
Multimedia on androidMultimedia on android
Multimedia on android
 
Variables in C Programming
Variables in C ProgrammingVariables in C Programming
Variables in C Programming
 
Java project-presentation
Java project-presentationJava project-presentation
Java project-presentation
 
Unit 3 sp assembler
Unit 3 sp assemblerUnit 3 sp assembler
Unit 3 sp assembler
 
Programming in c notes
Programming in c notesProgramming in c notes
Programming in c notes
 
ELECTRICITY BILLING SYSTEM (1).pptx
ELECTRICITY BILLING SYSTEM (1).pptxELECTRICITY BILLING SYSTEM (1).pptx
ELECTRICITY BILLING SYSTEM (1).pptx
 
Fourier transforms
Fourier transformsFourier transforms
Fourier transforms
 

Similar to Converter - C- Language Program

Temperature Converter is leay and I.pptx
Temperature Converter is leay and I.pptxTemperature Converter is leay and I.pptx
Temperature Converter is leay and I.pptx
asimshahzad8611
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
AASTHA76
 
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docxCMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
clarebernice
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
ssuserf86fba
 
An Energy-Efficient Climate Control Solution for Smart Buildings Based on Pre...
An Energy-Efficient Climate Control Solution for Smart Buildings Based on Pre...An Energy-Efficient Climate Control Solution for Smart Buildings Based on Pre...
An Energy-Efficient Climate Control Solution for Smart Buildings Based on Pre...
omar_afify
 
Programming preparation_stepping Algorithm
Programming preparation_stepping AlgorithmProgramming preparation_stepping Algorithm
Programming preparation_stepping Algorithm
leneinterno
 
Modeling separation systems_with_aspen_plus
Modeling separation systems_with_aspen_plusModeling separation systems_with_aspen_plus
Modeling separation systems_with_aspen_plus
Tecna
 

Similar to Converter - C- Language Program (20)

Temperature Converter is leay and I.pptx
Temperature Converter is leay and I.pptxTemperature Converter is leay and I.pptx
Temperature Converter is leay and I.pptx
 
02.softwareengr.ppt
02.softwareengr.ppt02.softwareengr.ppt
02.softwareengr.ppt
 
03b loops
03b   loops03b   loops
03b loops
 
Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)Performance analysis(Time & Space Complexity)
Performance analysis(Time & Space Complexity)
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
 
Object oriented programming 12 programming steps in cpp and example
Object oriented programming 12 programming steps in cpp and exampleObject oriented programming 12 programming steps in cpp and example
Object oriented programming 12 programming steps in cpp and example
 
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docxCMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
 
Comp 122 lab 5 lab report and source code
Comp 122 lab 5 lab report and source codeComp 122 lab 5 lab report and source code
Comp 122 lab 5 lab report and source code
 
Programming Fundamental handouts
Programming Fundamental handoutsProgramming Fundamental handouts
Programming Fundamental handouts
 
Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++Basic Programming concepts - Programming with C++
Basic Programming concepts - Programming with C++
 
detail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdfdetail of flowchart and algorithm that are used in programmingpdf
detail of flowchart and algorithm that are used in programmingpdf
 
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
Algorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTSAlgorithm   Flowchart Manual ALGORITHM   FLOWCHART MANUAL For STUDENTS
Algorithm Flowchart Manual ALGORITHM FLOWCHART MANUAL For STUDENTS
 
Algorithm manual
Algorithm manualAlgorithm manual
Algorithm manual
 
Evaluation of computer performance
Evaluation of computer performanceEvaluation of computer performance
Evaluation of computer performance
 
An Energy-Efficient Climate Control Solution for Smart Buildings Based on Pre...
An Energy-Efficient Climate Control Solution for Smart Buildings Based on Pre...An Energy-Efficient Climate Control Solution for Smart Buildings Based on Pre...
An Energy-Efficient Climate Control Solution for Smart Buildings Based on Pre...
 
finalpaper.doc
finalpaper.docfinalpaper.doc
finalpaper.doc
 
Programming preparation_stepping Algorithm
Programming preparation_stepping AlgorithmProgramming preparation_stepping Algorithm
Programming preparation_stepping Algorithm
 
Modeling separation systems_with_aspen_plus
Modeling separation systems_with_aspen_plusModeling separation systems_with_aspen_plus
Modeling separation systems_with_aspen_plus
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 
Visual Basic
Visual BasicVisual Basic
Visual Basic
 

More from Zuhaib Ali

More from Zuhaib Ali (11)

The Skill Enhancement Institute
The Skill Enhancement InstituteThe Skill Enhancement Institute
The Skill Enhancement Institute
 
Trade key
Trade keyTrade key
Trade key
 
Project report k&n’s
Project report k&n’sProject report k&n’s
Project report k&n’s
 
The curse of mummy’s tomb – Goosebumps
The curse of mummy’s tomb – GoosebumpsThe curse of mummy’s tomb – Goosebumps
The curse of mummy’s tomb – Goosebumps
 
Shezad roy
Shezad royShezad roy
Shezad roy
 
Sound
Sound Sound
Sound
 
Trade key
Trade keyTrade key
Trade key
 
Servis - Shoes for everyone..
Servis - Shoes for everyone..Servis - Shoes for everyone..
Servis - Shoes for everyone..
 
Professor Muhammad Yunus
Professor Muhammad YunusProfessor Muhammad Yunus
Professor Muhammad Yunus
 
Importance of Computer in Common man’s life in Society
Importance of Computer in Common man’s life in SocietyImportance of Computer in Common man’s life in Society
Importance of Computer in Common man’s life in Society
 
Gauss’s Law
Gauss’s LawGauss’s Law
Gauss’s Law
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

Converter - C- Language Program

  • 2.  Presented to: Miss Farah Nawaz Computer Science Department Newports Institute of Communication and Economics  Presented by: Muhammad Shoaib Zuhaib Ali  Coerce : Programming Techniques 1 Fall 2013
  • 3. CONVERTER  We have created a program “converter”.  The program is written in C Language.  That can converter Temperature, Time and Length.
  • 4. MAIN MENU OF PROGRAM
  • 5. PROGRAMMING Converter (C - Language Program)
  • 6. HEADER FILES  Only one header file is used in our program
  • 7. SWITCH CASE  We have used a “Switch Case” in this program. And give 4 cases.  Switch Case  Case 1 - Temperature  Case 2 - Time  Case 3 - Length  Case 4 - Exit
  • 8. IF FUNCTION  In first 3 case we used “If function”.  Temperature  If Celsius  Else if Fahrenheit  Else if Kelvin Time  If Day  Else if Hour  Else if Minute  Else if Second  Length  If Centimeter  Else if Foot  Else if Inch  Else if Meter 
  • 9. CUSTOM FUNCTION  We have created 11 custom functions in our program.  Temperature     Time      Celsius to all Fahrenheit to all Kelvin to all Day to all Hour to all Minute to all Second to all Length Centimeter to all  Foot to all  Inch to all  Meter to all 
  • 10. EXAMPLE OF CUSTOM FUNCTION CelsiusToAll() { float Celsius,Fahrenheit,Kelvin; clrscr(); printf("Enter Temperature in Celsius: "); scanf("%f",&Celsius); Fahrenheit=(1.8*Celsius)+32; Kelvin=(Celsius+273.15); printf("nTemperature in Fahrenheit : %.3f", Fahrenheit); printf("nTemperature in Kelvin : %.3fn", Kelvin); system("pause"); return 0; }
  • 11. FLOW CHART OF PROGRAM
  • 13. UNITS  In “Temperature Conversation” we have given 3 units. Celsius  Fahrenheit  Kelvin 
  • 14. FORMULAS  The formulas used for temperature conversations in this program are: From Temperature Fahrenheit Kelvin Celsius To Celsius = (Fahrenheit-32)/1.8 Kelvin-273.15 Fahrenheit Celsius*1.8 = (Kelvin*1.8)-459.67 Kelvin Celsius+273.15 (Fahrenheit+459.67)/1.8 =
  • 15. RESULT After selecting the input unit program the program ask to enter temperature in selected unit and calculate the result in other units and print it.  Example: 
  • 16. TIME
  • 17. UNITS  In “Time Conversation” we have given 4 units. Days  Hours  Minutes  Seconds 
  • 18. FORMULAS  The formulas used for time conversations in this program are From Time Hours Minutes Seconds Days = Hours/24 Minutes/60/24 Seconds/60/60/24 Hours Days*24 = Minutes/60 Seconds/60/60 Minutes Days*24*60 Hours*60 = Seconds/60 Seconds Days*24*60*60 Hours*60*60 Minutes*60 = To Days
  • 19. RESULT After selecting the input unit program the program ask to enter time in selected unit and calculate the result in other units and print it.  Example: 
  • 21. UNITS  In “Length Conversation” we have given 4 units. Centimeter  Foot  Inch  Meter 
  • 22. FORMULAS  The formulas used for Length conversations in this program are: From Length Foot Inch Meter Centimet er = Foot*30.48 Inch/0.3937 Meter*100 Foot Centimeter*0.033 = Inch/12 Meter/0.3048 Inch Centimeter*0.398 Foot*12 = Meter/0.0254 Meter Centimeter*100 Foot*0.3048 Inch/39.37 = To Centimeter
  • 23. RESULT After selecting the input unit program the program ask to enter Length in selected unit and calculate the result in other units and print it.  Example: 