-9f To C Code Example


Example: convert fahrenheit to celsius

import java.util.Scanner;  public class Main {      public static void main(String args[]) {         Scanner sc = new Scanner(System.in);         int far = sc.nextInt();         int cel = (far - 32) * 5/9;         System.out.printf("%d Fahrenheit is %d Celsius", far, cel);     } }

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable