Type Here to Get Search Results !

Celsius to Fahrenheit using Scanner function in java.


 Celsius to Fahrenheit using Scanner function in java.

Convert celsius to fahrenheitGiven a temperature C in Celsius, your task is to convert it into Fahrenheit using the following equation:- F = C × 9/5 + 32

Input :-

An integer, representing the Temperature in Celsuis.

User Task: :-

Convert the given temperature to Fahrenheit and print it.

Note :- 

It is guaranteed that C will be a multiple of 5.

Output :- 

Return a integer containing converted temperature in Fahrenheit.


Program :-

import java.util.*;
import java.io.*;

public class Main {
    public static void main(String args[]) {
     Scanner sc = new Scanner(System.in);
      int c = sc.nextInt();
      int T = 0;
      T = (c * 9)/5 + 32;

Sample Input :-


Sample Output:-

Sample Input:-

Sample Output:-

Common Mistakes
Do not print anything extra apart from the temperature in Fahrenheit.

Online Java Compiler -

Post a Comment