SlideShare une entreprise Scribd logo
1  sur  2
Please help I am using code blocks so cant use conio library
Please help I am using code blocks so cant use conio library
Write a program that convert integer Fahrenheit temperature to Celsius or Celsius to Fahrenheit.
Use floating points with 3-digit precision. Your program should 1- Prompt to CF or FC. Where
CF converting Celsius to Fahrenheit and FC to convert for converting from Fahrenheit to
Celsius. 2- Once you are ready to enter CF or FC, then Enter FC and then enter 5 testing values
all at once and hit enter to give the final answers in two colmuns Column 1: Your entered values
and Column 2: Your converted value. Repeat step a for CF a. b. Commands (paste text not
picture Output (paste picture
Solution
#include <stdio.h>
#include <string.h>
int main(){
char choice[2];
double temperature[5];
int i;
while(1){
printf("Enter CF or FC: ");
scanf("%s", choice);
if(strcmp(choice, "CF") != 0 && strcmp(choice, "FC") != 0) break;
printf("Enter 5 temperatures ");
for(i = 0; i < 5; i++){
scanf("%lf", &temperature[i]);
}
if(strcmp(choice, "CF") == 0){
printf("CelsiustFahrenheit ");
}
else printf("FahrenheittCelsius ");
for(i = 0; i < 5; i++){
printf("%.3lft", temperature[i]);
if(strcmp(choice, "CF") == 0){
printf("%.3lf ", temperature[i] * 1.8 + 32);
}
else printf("%.3lf ", (temperature[i] - 32) / 1.8);
}
}
}

Contenu connexe

Similaire à Please help I am using code blocks so cant use conio library Please.docx

Datastructurenotes 100627004340-phpapp01
Datastructurenotes 100627004340-phpapp01Datastructurenotes 100627004340-phpapp01
Datastructurenotes 100627004340-phpapp01
Getachew Ganfur
 
Exposure Interval Initial Risk Assessment (with exist.docx
Exposure Interval    Initial Risk Assessment (with exist.docxExposure Interval    Initial Risk Assessment (with exist.docx
Exposure Interval Initial Risk Assessment (with exist.docx
ssuser454af01
 
Exercise6 ch2
Exercise6 ch2Exercise6 ch2
Exercise6 ch2
IIUM
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
Vivek Singh
 

Similaire à Please help I am using code blocks so cant use conio library Please.docx (14)

Using matlab simulink
Using matlab simulinkUsing matlab simulink
Using matlab simulink
 
Code optimization
Code optimizationCode optimization
Code optimization
 
Code optimization
Code optimizationCode optimization
Code optimization
 
cscript_controller.pdf
cscript_controller.pdfcscript_controller.pdf
cscript_controller.pdf
 
complete data structure
complete data structurecomplete data structure
complete data structure
 
Datastructurenotes 100627004340-phpapp01
Datastructurenotes 100627004340-phpapp01Datastructurenotes 100627004340-phpapp01
Datastructurenotes 100627004340-phpapp01
 
Complete c programming presentation
Complete c programming presentationComplete c programming presentation
Complete c programming presentation
 
Exposure Interval Initial Risk Assessment (with exist.docx
Exposure Interval    Initial Risk Assessment (with exist.docxExposure Interval    Initial Risk Assessment (with exist.docx
Exposure Interval Initial Risk Assessment (with exist.docx
 
C operators
C operatorsC operators
C operators
 
C programming of an ARM microcontroller and writing UART serial communication...
C programming of an ARM microcontroller and writing UART serial communication...C programming of an ARM microcontroller and writing UART serial communication...
C programming of an ARM microcontroller and writing UART serial communication...
 
Exercise6 ch2
Exercise6 ch2Exercise6 ch2
Exercise6 ch2
 
Discussing Fundamentals of C
Discussing Fundamentals of CDiscussing Fundamentals of C
Discussing Fundamentals of C
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
Cmis 102 Effective Communication / snaptutorial.com
Cmis 102  Effective Communication / snaptutorial.comCmis 102  Effective Communication / snaptutorial.com
Cmis 102 Effective Communication / snaptutorial.com
 

Plus de ellenj4

The Homeland Security Act of 2002 is divided into 17 titles while brin.docx
The Homeland Security Act of 2002 is divided into 17 titles while brin.docxThe Homeland Security Act of 2002 is divided into 17 titles while brin.docx
The Homeland Security Act of 2002 is divided into 17 titles while brin.docx
ellenj4
 
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docxThe Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
ellenj4
 
The following information pertains to Naomi Campbell Company as of Dec.docx
The following information pertains to Naomi Campbell Company as of Dec.docxThe following information pertains to Naomi Campbell Company as of Dec.docx
The following information pertains to Naomi Campbell Company as of Dec.docx
ellenj4
 
The G Banking Group recently reported that it was offshoring (moving).docx
The G Banking Group recently reported that it was offshoring (moving).docxThe G Banking Group recently reported that it was offshoring (moving).docx
The G Banking Group recently reported that it was offshoring (moving).docx
ellenj4
 

Plus de ellenj4 (20)

The function and process whereby physicians- nurses- and social worker.docx
The function and process whereby physicians- nurses- and social worker.docxThe function and process whereby physicians- nurses- and social worker.docx
The function and process whereby physicians- nurses- and social worker.docx
 
The four components of aggregate expenditures are- Question 3 options-.docx
The four components of aggregate expenditures are- Question 3 options-.docxThe four components of aggregate expenditures are- Question 3 options-.docx
The four components of aggregate expenditures are- Question 3 options-.docx
 
The IS staff wants to know about important management tools built into.docx
The IS staff wants to know about important management tools built into.docxThe IS staff wants to know about important management tools built into.docx
The IS staff wants to know about important management tools built into.docx
 
The Inventive Co- is considering a new project- This project requires.docx
The Inventive Co- is considering a new project- This project requires.docxThe Inventive Co- is considering a new project- This project requires.docx
The Inventive Co- is considering a new project- This project requires.docx
 
The internal document that is prepared to notify the appropriate perso.docx
The internal document that is prepared to notify the appropriate perso.docxThe internal document that is prepared to notify the appropriate perso.docx
The internal document that is prepared to notify the appropriate perso.docx
 
The Impact of Technology on the Developing Child name 7 negative ways.docx
The Impact of Technology on the Developing Child name 7 negative ways.docxThe Impact of Technology on the Developing Child name 7 negative ways.docx
The Impact of Technology on the Developing Child name 7 negative ways.docx
 
The Homeland Security Act of 2002 is divided into 17 titles while brin.docx
The Homeland Security Act of 2002 is divided into 17 titles while brin.docxThe Homeland Security Act of 2002 is divided into 17 titles while brin.docx
The Homeland Security Act of 2002 is divided into 17 titles while brin.docx
 
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docxThe Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
The Homeland Security Act of 2002 is divided into 17 titles while brin (1).docx
 
The following table contains national income accounting data for a hyp.docx
The following table contains national income accounting data for a hyp.docxThe following table contains national income accounting data for a hyp.docx
The following table contains national income accounting data for a hyp.docx
 
The following items are taken from the financial statements of the Pos.docx
The following items are taken from the financial statements of the Pos.docxThe following items are taken from the financial statements of the Pos.docx
The following items are taken from the financial statements of the Pos.docx
 
The following program has already been written to populate its data ar.docx
The following program has already been written to populate its data ar.docxThe following program has already been written to populate its data ar.docx
The following program has already been written to populate its data ar.docx
 
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docx
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docxThe German philosopher Immanuel Kant condemned Utilitarianism as an im.docx
The German philosopher Immanuel Kant condemned Utilitarianism as an im.docx
 
The graph of temperature versus molar mass is given for the hydrides o.docx
The graph of temperature versus molar mass is given for the hydrides o.docxThe graph of temperature versus molar mass is given for the hydrides o.docx
The graph of temperature versus molar mass is given for the hydrides o.docx
 
The general role of financial intermediaries is to- A-Provide advice t (1).docx
The general role of financial intermediaries is to- A-Provide advice t (1).docxThe general role of financial intermediaries is to- A-Provide advice t (1).docx
The general role of financial intermediaries is to- A-Provide advice t (1).docx
 
The general role of financial intermediaries is to- A-Provide advice t.docx
The general role of financial intermediaries is to- A-Provide advice t.docxThe general role of financial intermediaries is to- A-Provide advice t.docx
The general role of financial intermediaries is to- A-Provide advice t.docx
 
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docx
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docxThe functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docx
The functional group RCO2R-' is characteristic of a(n) ____- 1) 2) 3).docx
 
The following information pertains to Naomi Campbell Company as of Dec.docx
The following information pertains to Naomi Campbell Company as of Dec.docxThe following information pertains to Naomi Campbell Company as of Dec.docx
The following information pertains to Naomi Campbell Company as of Dec.docx
 
The G Banking Group recently reported that it was offshoring (moving).docx
The G Banking Group recently reported that it was offshoring (moving).docxThe G Banking Group recently reported that it was offshoring (moving).docx
The G Banking Group recently reported that it was offshoring (moving).docx
 
Please do not answer if you-'re unsure of the answer- Thanks!.docx
Please do not answer if you-'re unsure of the answer- Thanks!.docxPlease do not answer if you-'re unsure of the answer- Thanks!.docx
Please do not answer if you-'re unsure of the answer- Thanks!.docx
 
Please describe the process of the Implementation of Role-based access.docx
Please describe the process of the Implementation of Role-based access.docxPlease describe the process of the Implementation of Role-based access.docx
Please describe the process of the Implementation of Role-based access.docx
 

Dernier

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
SanaAli374401
 

Dernier (20)

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

Please help I am using code blocks so cant use conio library Please.docx

  • 1. Please help I am using code blocks so cant use conio library Please help I am using code blocks so cant use conio library Write a program that convert integer Fahrenheit temperature to Celsius or Celsius to Fahrenheit. Use floating points with 3-digit precision. Your program should 1- Prompt to CF or FC. Where CF converting Celsius to Fahrenheit and FC to convert for converting from Fahrenheit to Celsius. 2- Once you are ready to enter CF or FC, then Enter FC and then enter 5 testing values all at once and hit enter to give the final answers in two colmuns Column 1: Your entered values and Column 2: Your converted value. Repeat step a for CF a. b. Commands (paste text not picture Output (paste picture Solution #include <stdio.h> #include <string.h> int main(){ char choice[2]; double temperature[5]; int i; while(1){ printf("Enter CF or FC: "); scanf("%s", choice); if(strcmp(choice, "CF") != 0 && strcmp(choice, "FC") != 0) break; printf("Enter 5 temperatures "); for(i = 0; i < 5; i++){ scanf("%lf", &temperature[i]); } if(strcmp(choice, "CF") == 0){ printf("CelsiustFahrenheit "); } else printf("FahrenheittCelsius "); for(i = 0; i < 5; i++){
  • 2. printf("%.3lft", temperature[i]); if(strcmp(choice, "CF") == 0){ printf("%.3lf ", temperature[i] * 1.8 + 32); } else printf("%.3lf ", (temperature[i] - 32) / 1.8); } } }