1. Anasayfa
  2. Nesne Tabanlı Programlama

Visual C# ile girilen sayının kuvvetini almak


0

Visual C# ile girilen sayının kuvvetini almak için console uygulaması açıp girilen sayılara göre Math.Pow fonksiyonu ile hesaplayıp ekranda gösteriyoruz.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
staticvoid Main(string[] args)
{
// girilen sayının kaçıncı kuvveti isternirse ekrana yazan program :)
int a = new int();
int b = new int();
Console.Write(“sayı Giriniz=);
a = Convert.ToInt32(Console.ReadLine());
Console.Write(“Kacinci Kuvveti=);
b = Convert.ToInt32(Console.ReadLine());
Console.Write(“Toplam=);
Console.Write((Math.Pow(a, b)));
Console.ReadKey();
}
}
}

Bu İçeriğe Tepkin Ne Oldu?
  • 0
    ba_ar_l_
    Başarılı
  • 1
    gayet_yi
    Gayet İyi
  • 0
    te_ekk_rler
    Teşekkürler
  • 1
    anlamad_m
    Anlamadım
  • 1
    yetersiz
    Yetersiz
Subscribe
Bildir
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Yorum
Inline Feedbacks
View all comments