본문 바로가기
C#

뇌를 자극하는 C# 5.0 프로그래밍 연습문제 6장 1번

by JAESEONG LEE- developer 2022. 7. 26.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ee
{
    class MainApp
    {
 
        static double Square(double arg)
        {
            return arg * arg;
        }
 
        static void Main(string[] args)
        {
            Console.WriteLine("수를 입력하세요. :");
            string input = Console.ReadLine();
            double arg = Convert.ToDouble(input);
            Console.WriteLine("결과:{0}",Square(arg));
        }
 
    }
}
cs