CONVERTER
C- Language Program


Presented to:

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

Presen...
CONVERTER


We have created a program “converter”.



The program is written in C Language.



That can converter Tempe...
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


...
IF FUNCTION


In first 3 case we used
“If function”.



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

...
CUSTOM FUNCTION


We have created 11 custom functions in our program.



Temperature






Time







Celsius ...
EXAMPLE OF CUSTOM FUNCTION
CelsiusToAll()
{
float Celsius,Fahrenheit,Kelvin;
clrscr();
printf("Enter Temperature in Celsiu...
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

Cels...
RESULT
After selecting the input unit program the program
ask to enter temperature in selected unit and
calculate the resu...
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...
RESULT
After selecting the input unit program the program
ask to enter time in selected unit and calculate the
result in o...
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

=
...
RESULT
After selecting the input unit program the program
ask to enter Length in selected unit and calculate
the result in...
PENFLIX
THANK YOU
Upcoming SlideShare
Loading in …5
×

Converter - C- Language Program

956 views

Published on

This is the presentation of a program made by me and my friend Shoaib Khan, This program is written in C Language. If you want the copy of this program write me...

Published in: Technology, Business
  • Be the first to comment

Converter - C- Language Program

  1. 1. CONVERTER C- Language Program
  2. 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. 3. CONVERTER  We have created a program “converter”.  The program is written in C Language.  That can converter Temperature, Time and Length.
  4. 4. MAIN MENU OF PROGRAM
  5. 5. PROGRAMMING Converter (C - Language Program)
  6. 6. HEADER FILES  Only one header file is used in our program
  7. 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. 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. 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. 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. 11. FLOW CHART OF PROGRAM
  12. 12. TEMPERATURE
  13. 13. UNITS  In “Temperature Conversation” we have given 3 units. Celsius  Fahrenheit  Kelvin 
  14. 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. 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. 16. TIME
  17. 17. UNITS  In “Time Conversation” we have given 4 units. Days  Hours  Minutes  Seconds 
  18. 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. 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: 
  20. 20. LENGTH
  21. 21. UNITS  In “Length Conversation” we have given 4 units. Centimeter  Foot  Inch  Meter 
  22. 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. 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: 
  24. 24. PENFLIX
  25. 25. THANK YOU

×