write a c program to convert fahrenheit to celsius?
Answer Posted / faizan
/*Logic== C=(f-32)/1.8 ==*/
#include<stdio.h>
#include<conio.h>
#define f_low 0
#define f_max 250
#define step 25
void main()
{
typedef float real;
real fahrenheit,celsius;
clrscr();
fahrenheit=f_low;
printf("Fahrenheit Celsius\n\n");
while(fahrenheit<=f_max)
{
celsius=(fahrenheit-32.0)/1.8;
printf("%5.1f
%7.2f\n\n",fahrenheit,celsius);
fahrenheit=fahrenheit+step;
}
getch();
}
| Is This Answer Correct ? | 26 Yes | 13 No |
Post New Answer View All Answers
What language is lisp written in?
What are header files and explain what are its uses in c programming?
Do pointers take up memory?
What are local static variables?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
What is a newline escape sequence?
Explain what is the difference between functions getch() and getche()?
What is the purpose of clrscr () printf () and getch ()?
Is c dynamically typed?
Write a Program to accept different goods with the number, price and date of purchase and display them
How can I run c program?
What is the use of typedef in structure in c?
What do mean by network ?
How can my program discover the complete pathname to the executable from which it was invoked?
Explain the use of 'auto' keyword