Practical - 3 - Write a program to read temperature in Celsius and convert it into Fahrenheit (F = 1.8 * C + 32).

Practical - 3


Aim: Write a program to read temperature in Celsius and convert it into Fahrenheit (F = 1.8 * C + 32).

Program:

#include <stdio.h>

#include <conio.h>

 

void main()

{

    clrscr();

    int c, f;

 

    printf("Enter the value 'Celsius' = ");

    scanf("%d", &c);

 

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

    printf("\nFahrenheit = %d", f);

 

    getch();

}

 

Output:

Enter the value 'Celsius' = 32

 

Fahrenheit = 89

 

Algorithm:

Step-1: START

Step-2: Declare c, f.

Step-3: Enter the value of c.

Step-4: f = ((1.8 * c) + 32)

Step-5: Display f.

Step-6: STOP

 

Flowchart:




Post a Comment

0 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.