「C#入門」データ(double、bool)型を使うサンプル
書式
double 変数名
char 変数名
使用例
using System;
namespace TestApplication
{
class Program
{
static void Main(string[] args)
{
int ccNum = 6; // integer
double ccDoubleNum = 6.89D; // floating point number
char ccLetter = 'E'; // character
bool ccBool = true; // boolean
string ccText = "study skill"; // string
Console.WriteLine(ccNum);
Console.WriteLine(ccDoubleNum);
Console.WriteLine(ccLetter);
Console.WriteLine(ccBool);
Console.WriteLine(ccText);
}
}
}
using System;
namespace TestApplication
{
class Program
{
static void Main(string[] args)
{
int ccNum = 6; // integer
double ccDoubleNum = 6.89D; // floating point number
char ccLetter = 'E'; // character
bool ccBool = true; // boolean
string ccText = "study skill"; // string
Console.WriteLine(ccNum);
Console.WriteLine(ccDoubleNum);
Console.WriteLine(ccLetter);
Console.WriteLine(ccBool);
Console.WriteLine(ccText);
}
}
}
using System; namespace TestApplication { class Program { static void Main(string[] args) { int ccNum = 6; // integer double ccDoubleNum = 6.89D; // floating point number char ccLetter = 'E'; // character bool ccBool = true; // boolean string ccText = "study skill"; // string Console.WriteLine(ccNum); Console.WriteLine(ccDoubleNum); Console.WriteLine(ccLetter); Console.WriteLine(ccBool); Console.WriteLine(ccText); } } }
結果
6
6.89
E
True
study skill