1.14: Conversion

OBJECTIVE

Create a C# program to convert from celsius degrees to Kelvin and Fahrenheit: it will ask the user for the amount of celsius degrees and using the following conversion tables: 

kelvin = celsius + 273 
fahrenheit = celsius x 18 / 10 + 32 

RESOLUTION


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace My3Development
{
public class Conversion
{
    public static void Main(String[] args)
    {
       
        Console.Write("Enter the amount of celsius: "); 
        int celsius = Convert.ToInt32(Console.ReadLine());
 
        Console.WriteLine("Kelvin = {0}", celsius + 273);
        Console.WriteLine("Fahrenheit = {0}", celsius * 18 / 10 + 32);
            
       Console.ReadKey();
        
        }
    }
 }

DEMO RESULT


                   PREVIOUS                                                HOME                                                        

0 comments :

Please Enter best of your Comments