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


Please Help Members By Posting Answers For Below Questions

plz let me know how to become a telecom protocol tester. thank you.

1743


What is the code in while loop that returns the output of given code?

1320


Write a program to show the change in position of a cursor using c

584


What is #include cctype?

580


You have given 2 array. You need to find whether they will create the same BST or not. For example: Array1:10 5 20 15 30 Array2:10 20 15 30 5 Result: True Array1:10 5 20 15 30 Array2:10 15 20 30 5 Result: False One Approach is Pretty Clear by creating BST O(nlogn) then checking two tree for identical O(N) overall O(nlogn) ..we need there exist O(N) Time & O(1) Space also without extra space .Algorithm ?? DevoCoder guest Posted 3 months ago # #define true 1 #define false 0 int check(int a1[],int a2[],int n1,int n2) { int i; //n1 size of array a1[] and n2 size of a2[] if(n1!=n2) return false; //n1 and n2 must be same for(i=0;ia1[i+1]) && (a2[i]>a2[i+1]) ) ) return false; } return true;//assumed that each array doesn't contain duplicate elements in themshelves }

2714






What functions are used for dynamic memory allocation in c language?

602


What is function and its example?

628


What is floating point constants?

693


please explain clearly about execution of c program in detail,in which stage are the printf sacnf getting into exeecutable code

1708


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1467


What is a char c?

594


Explain what are header files and explain what are its uses in c programming?

628


write a program that reads lines(using getline), converts each line to an integer using atoi, and computes the average of all the numbers read. also compute the standard deviation.

1984


which is an algorithm for sorting in a growing Lexicographic order

1398


What is difference between union and structure in c?

580