8 Aralık 2014 Pazartesi

C# Uzun ve kısa çapları kullanıcıdan istenen bir elipsin alanını ve çevresini hesaplayıp ekrana yazan bir program

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

namespace orn2
{
    class Program
    {
        static void Main(string[] args)
        {
            double g, y, alan, cevre;
            Console.Write("Yükseklik gir: ");
            double.TryParse(Console.ReadLine(), out y);
            Console.Write("genişlik gir: ");
            double.TryParse(Console.ReadLine(), out g);
            alan = g * y * Math.PI / 4;
            cevre = (g + y) * Math.PI / 2;
            Console.Write("Alan= "+alan);
            Console.Write("\nÇevre= "+cevre);
            Console.ReadKey();
        }
    }
}
Paylaş:

0 yorum:

Yorum Gönder

Popüler

Son

Kategoriler

Arşiv