ITHelpself / CSharp-team-lttq

0 stars 0 forks source link

2. for #2

Open nhokhacam1 opened 4 years ago

nhokhacam1 commented 4 years ago

for (statement 1; statement 2; statement 3) { // code block to be executed }

nhokhacam1 commented 4 years ago

viet chuong trinh in helloworld 10 lan

Duynguyen1819 commented 4 years ago
           for (int i = 0; i < 10; i = i + 1 )
            {
                Console.WriteLine("Hello World!");
            }
nhokhacam1 commented 4 years ago

i = i + 1 giong i++ giong i+=1

ITHelpself commented 4 years ago
for(int i=0;i<10 ;i = i+1 )
            {
                Console.WriteLine("Hello World!");

            }
nhokhacam1 commented 4 years ago

int: 0,1,2,3,4,5,6,-1,-2,...

ITHelpself commented 4 years ago
 int n = 5;
            for(int i=0;i<n;i++ )
            {
                Console.WriteLine("Hello World!");

            }
Duynguyen1819 commented 4 years ago
  int n = 5;
            for (int i = 0; i < n; i++) 
            {
                Console.WriteLine("Hello World!");
            }
ITHelpself commented 4 years ago
 int n = 5;
            n = 6;
            for(int i=0;i<n;i++ )
            {
                Console.WriteLine("Hello World!");

            }
Duynguyen1819 commented 4 years ago
     const int n = 5;
            for (int i = 0; i < n; i++) 
            {
                Console.WriteLine("Hello World!");
            }
ITHelpself commented 4 years ago
 static void display(int n)
        {
            for (int i = 0; i < n; i++)
            {
                Console.WriteLine("Hello World!");

            }
        }
        static void Main(string[] args)
        {
            int n = 5;
            n = 6;
            display(n);
        }
nhokhacam1 commented 4 years ago

cho a,b viet chuong trinh in ra tong 2 so