Centigrade to farenheit conversion

 Centigrade to farenheit conversion



Problem Description


Java Program to convert from centrigrade to farenheit

Logic Test Case 1


Input (stdin)

32


Expected Output


89.6

Logic Test Case 2


Input (stdin)

38


Expected Output


100.4




Code Area

import java.io.*;

import java.util.*;

public class TestClass {

public static void main(String[] args) { 

float cen;

        double fah;

        Scanner scan = new Scanner(System.in);

        //System.out.print("Enter Temperature in Centigrade : ");

        cen = scan.nextFloat();

        fah = (1.8*cen) + 32;

        System.out.print(fah);

}

}


Post a Comment

0 Comments