C# 0 The Complete Reference


PART I C h a p t e r   3



Download 4,07 Mb.
Pdf ko'rish
bet120/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   116   117   118   119   120   121   122   123   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt


PART I

C h a p t e r   3 :  

D a t a   T y p e s ,   L i t e r a l s ,   a n d   V a r i a b l e s  

61

PART IPART I



       Console.WriteLine("The square root of {0} is {1}",

                         n, Math.Sqrt(n));

       Console.WriteLine("Whole number part: {0}" ,

                         (int) Math.Sqrt(n));

       Console.WriteLine("Fractional part: {0}",

                         Math.Sqrt(n) - (int) Math.Sqrt(n) );

       Console.WriteLine();

    }


  }

}

Here is the output from the program:



The square root of 1 is 1

Whole number part: 1

Fractional part: 0

The square root of 2 is 1.4142135623731

Whole number part: 1

Fractional part: 0.414213562373095

The square root of 3 is 1.73205080756888

Whole number part: 1

Fractional part: 0.732050807568877

The square root of 4 is 2

Whole number part: 2

Fractional part: 0

The square root of 5 is 2.23606797749979

Whole number part: 2

Fractional part: 0.23606797749979

The square root of 6 is 2.44948974278318

Whole number part: 2

Fractional part: 0.449489742783178

The square root of 7 is 2.64575131106459

Whole number part: 2

Fractional part: 0.645751311064591

The square root of 8 is 2.82842712474619

Whole number part: 2

Fractional part: 0.82842712474619

The square root of 9 is 3

Whole number part: 3

Fractional part: 0

The square root of 10 is 3.16227766016838

Whole number part: 3

Fractional part: 0.16227766016838

www.freepdf-books.com



62

 

P a r t   I :  



T h e   C #   L a n g u a g e

As the output shows, the cast of 




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   116   117   118   119   120   121   122   123   ...   1096




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish