c#

    [C#] 배열 사용해보기

    [C#] 배열 사용해보기

    0. 배열(Array) 배열이란 동일한 타입의 변수를 모아놓은 데이터 집합이다. 1. 주어진 숫자 중에서 최대, 최소값 출력해보기 using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { int a = 5, b = 8, c = 9, max = a, min = a; Console.WriteLine("a={0}, b={1}, c={2}", a, b, c); if (max b) min = b; if (min > c) min = c; Console.WriteLine("최대값은 {0}입니다.", max); Console.WriteLi..

    [C#] 중첩for문 사용하기

    [C#] 중첩for문 사용하기

    1. 중첩for문을 이용하여 ########## 20줄 표시하기 using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { int i, e; for(e=1;e

    [C#] for문과 while 반복문 익숙해지기

    [C#] for문과 while 반복문 익숙해지기

    1. for문을 이용하여 1~10까지 출력하기 using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { for(int a=1;a

    [C#] for 문을 사용하여 구구단 출력하며 익숙해지기

    [C#] for 문을 사용하여 구구단 출력하며 익숙해지기

    using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { for(int i=0;i

    [C#] C#의 기본적인 출력문과 이스케이프 시퀀스

    [C#] C#의 기본적인 출력문과 이스케이프 시퀀스

    using System; namespace ConsoleApp1 { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); //Hello World! 출력 후 줄바꿈 Console.WriteLine("a=10"); //a=10 출력 후 줄바꿈 Console.WriteLine("b=20"); //b=20 출력 후 줄바꿈 Console.Write("a+b = "); //a+b = 출력 Console.WriteLine(10 + 20); //10+20을 계산한 값 출력 후 줄바꿈 // +분만 아니라 - * / % 또한 사용이 가능하다 Console.WriteLine("Hello \tWorld"); // \t를 사용 ..