開発環境
- OS: Windows 10 Pro
- IDE(統合開発環境): Visual Studio Community 2017
初めてのC# 第2版 (Jesse Liberty (著)、Brian MacDonald (著)、日向 俊二 (翻訳)、オライリージャパン)の8章(メソッド)、8.5(練習問題)、問題8-3.を取り組んでみる。
コード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.IO;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
int x = 10;
int a, b;
DoubleAndTriple(x, out a, out b);
Console.WriteLine(a);
Console.WriteLine(b);
}
public static void DoubleAndTriple(int a, out int b, out int c)
{
b = 2 * a;
c = 3 * a;
}
}
}
入出力結果(コマンドプロンプト)
20 30 続行するには何かキーを押してください . . .
0 コメント:
コメントを投稿