Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Name: OLIVER CAMILLE JOY R

Section: 1F6

ACTIVITY 2

Instruction: Copy your working code and paste it here. Make sure to include your name in the
code using comments.
[!!] How to use comments? By using forward slash //

Write a program that converts a temperature from Fahrenheit to Celsius and display “Boiling
point reached” if Celsius is greater than or equal to 100, otherwise display “Freezing point
reached”.
Formula: Celsius = (Fahrenheit - 32) * 5 / 9; (20 points)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks
namespace OLIVER_CAMILLE_JOY
{
class Program
{
static void Main(string[] args)
{
// OLIVER CAMILLE JOY R
// 1-F6

int fahreinheit, celcius;

Console.Write("Enter a number:");
fahreinheit = int.Parse(Console.ReadLine());
celcius = (fahreinheit - 32) * 5 / 9;

if (celcius >= 100)


Console.Write("Boiling point");
else
Console.Write("Freezing point reached");

Console.ReadKey();

}
}
}
Create a program that compares two numbers and prints whether they are equal, or not. (20
points)

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

namespace ConsoleApplication11
{
class Program
{
static void Main(string[] args)
{
// OLIVER CAMILLE JOY R
// 1-F6

int num1, num2;

Console.Write("Enter first number:");


num1 = int.Parse(Console.ReadLine());
Console.Write("Enter second number:");
num2 = int.Parse(Console.ReadLine());

if (num1 == num2)
Console.Write("Equal");
else
Console.Write("Not Equal");

Console.ReadKey();

}
}
}

You might also like