본문 바로가기
c#/수업 내용

for 문

by 이지훈26 2021. 8. 20.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Helloworld2
{
    class Program
    {
        
        static void Main(string[] args)
        {
            string name = "홍길동";

            //출력
            //홍길동님 환영합니다
            Console.WriteLine("{0}님 환영합니다", name);

            //홍길동님 환영합니다
            //홍길동님 환영합니다
            //홍길동님 환영합니다
            //홍길동님 환영합니다
            //홍길동님 환영합니다
            //홍길동님 환영합니다
            //홍길동님 환영합니다
            //... 10000번


            //반복문 for문
            //무엇인가를 횟수 만큼 반복하고 하고 싶다
            
            //5번 for문의 본문을 반복문의 for문의기본형
            for(int i = 0; i<5; i++)
            {
                Console.WriteLine("hello World");

            }

        }
    }
}

'c# > 수업 내용' 카테고리의 다른 글

연습 문제 2번  (0) 2021.08.20
연습 문제 1번  (0) 2021.08.20
IF ~ else 실패  (0) 2021.08.20
if ~ else  (0) 2021.08.20
연습과제2번  (0) 2021.08.20