Dairenin alanını ve çevresini bulma C#

Dairenin alanını ve çevresini bulma C#

[code lang=”csharp”]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
const float pi = 3.14f;
float cevre, alan;
int r;
r = Convert.ToInt32(textBox1.Text);
alan = pi * r * r;
cevre = 2 * pi * r;
textBox2.Text = alan.ToString();
textBox3.Text = cevre.ToString();
}
}
}
[/code]

Yorumlar 1

  • buda girilen sayının karesini ve kübünü bulur:

    Console.WriteLine(“GİRİLEN SAYININ KARESİNİ BULUR !!!!! “);
    Console.WriteLine(“”);
    Console.WriteLine(“”);
    int x, sonuc;
    Console.Write(“Lütfen Sayıyı Giriniz :”);
    x = Convert.ToInt16(Console.ReadLine());
    sonuc = x * x;
    Console.WriteLine(“Girdiğiniz Sayının Karesi ={0}”, sonuc);
    Console.WriteLine(“–*–*–*–*–*–*–*–*–*–*–*–*–*–*–*”);
    Console.WriteLine(“”);
    Console.WriteLine(“”);
    Console.WriteLine(” BU PROGRAMI YAPAN YUNUS EMRE ÇAKIR “);
    Console.WriteLine(“–*–*–*–*–*–*–*–*–*–*–*–*–*–*–*–*”); Console.WriteLine(“”);
    Console.WriteLine(“”);
    Console.WriteLine(“”);
    Console.WriteLine(“**-**-**-**-**-**-**-**-**-**-**-**-**-**-**-**-**-“);
    Console.WriteLine(“GİRİLEN SAYININ KÜPÜNÜ BULUR !!!!!!”);
    Console.WriteLine(“”);
    Console.WriteLine(“”);
    int y, sonuç;
    Console.Write(“BİR SAYI GİRİNİZ :”);
    y = Convert.ToInt16(Console.ReadLine());
    sonuç = y * y * y;
    Console.WriteLine(“GİRDİĞİNİZ SAYININ KÜPÜ={0}”, sonuç);
    Console.WriteLine(“”);
    Console.WriteLine(“”);

    Console.WriteLine(” PENDİK TÜRK TELEKOM MES. VE TEK.AND LİSESİ/İSTANBUL”);
    Console.ReadKey();

Bir yanıt yazın

E-posta adresiniz yayınlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir