Search Your Keyword

A One Massage for users

C Program BD say you

Hi, If you are new in our blog and to get support about C program, than you must select your level from right side in this blog.Such as, If you want to learn than you select Entry Level for learning and If you are known the basic of C program than you select Solution Level.


Sunday, July 7, 2019

Q4. Write a c program to convert the temperature from celsius to fahrenheit and vice- versa.

celsius to fahrenheit and vice- versa:-
#include<stdio.h>
#include<conio.h>

void main()
{
float f,c;
char key;

clrscr();
printf("Enter F = Fahrenheit or \n C = Celsius.");



printf("Enter:-");
scanf("%c",&key);

if((key == 'C')||(key == 'c'))
{
printf("\n Enter Fahrenhit number=");
scanf("%f",&f);

c = (f-32.0)/1.8;

printf("Celsius = %f",c);
}

else if((key == 'C')||(key == 'c'))
{
printf("\n Enter Celsius number=");
scanf("%f",&c);

f = ((c*1.8)+32.0);

printf("Fahrenhit = %f",f);
}

else
{
printf("Your Input is worng Press.");
}
getch();
}

<b><u>Note:-</u></b>
Here,
f for Fahrenhit,
c for Celsius and
key for another one veriable.

fahrenheit to celsius c program, celsius to fahrenheit c program,

Write a C pogram celsius to fahrenheit and vice- versa.
C program to calculate fahrenheit and celsius and vice - versa,
fahrenheit to celsius c program, celsius to fahrenheit c program,
C program, C programming language.

No comments:

Post a Comment