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
How can I make it pause before closing the program output window?
What is "Hungarian Notation"?
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?
why we wont use '&' sing in aceesing the string using scanf
What is wrong with this program statement? void = 10;
Can you please explain the scope of static variables?
Write a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
Is it fine to write void main () or main () in c?
Is c# a good language?
What is infinite loop?
What is a structure in c language. how to initialise a structure in c?
Is c++ based on c?
What is meant by 'bit masking'?
Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant
What are the advantage of c language?