using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Latihan4
{
class Program
{
static void Main(string[] args)
{
double firtsNumber, secondNumber;
string userName;
Console.WriteLine("Write Your Name: ");
userName = Console.ReadLine();
Console.WriteLine("Welcome {0}!", userName);
Console.WriteLine("Now give me a number: ");
firtsNumber = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Now give me another number : ");
secondNumber = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("The sum of {0} and {1} is {2} . ", firtsNumber, secondNumber, firtsNumber + secondNumber);
Console.WriteLine("The result of substracting {0} from {1} is {2}.", secondNumber, firtsNumber, firtsNumber - secondNumber);
Console.WriteLine("The product of {0} and {1} is {2}.", firtsNumber, secondNumber, firtsNumber * secondNumber);
Console.WriteLine("The result of dividing {0} by {1} is {2}.", firtsNumber, secondNumber, firtsNumber / secondNumber);
Console.WriteLine("The remainder after dividing {0} by {1} is {2}.", firtsNumber, secondNumber, firtsNumber % secondNumber);
Console.ReadKey();
}
}
}
Tidak ada komentar:
Posting Komentar