C#/C# 연습

Operation : 연산자

HicKee 2022. 11. 28. 12:15
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pr_01 {
    internal class Program {
        static void Main(string[] args) {
            int a = 100;
            int b = 100;
            int c = a+b;
            Console.WriteLine(c);
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pr_01 {
    internal class Program {
        static void Main(string[] args) {
        
            int a = 1;
            int total = 0;
            for (int i = 0; i < 100; i++) {
                total+= a+i;
            }
            Console.WriteLine(total);
        }
    }
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace pr_01 {
    internal class Program {
        static void Main(string[] args) {
          
            int a = 3;
    
            for (int i = 1; i < 10; i++) {

                Console.WriteLine(a +" x " +i + " = "+a*i);
                Console.WriteLine("{0} x {1} = {2}", a, i, a * i);

            }
        }
    }
}

 

'C# > C# 연습' 카테고리의 다른 글

Array : Length input, Random (배열수 입력, 난수)  (0) 2022.11.28
for, While : Buger (버거)  (0) 2022.11.28
Data Type Casting : 자료형 변환  (0) 2022.11.27
입력  (0) 2022.11.27
Variable : 변수  (0) 2022.11.27