جدول ضرب آرایه 2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitiazeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
int[,] a = new int[10, 10];
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
a[i, j] = (j + 1) * (i + 1);
}
label3.Text = "";
}
for (int i = 0; i < 10; i++)
{
for (int j = 0; j < 10; j++)
{
label3.Text += a[i, j].ToString() + " ";
}
label3.Text += "\n";
}
}
private void InitializeComponent()
{
this.label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(69, 78);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(35, 13);
this.label3.TabIndex = 0;
this.label3.Text = "label3";
//
// Form1
//
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.label3);
this.Name = "Form1";
this.Load += new System.EventHandler(this.Form1_Load_1);
this.ResumeLayout(false);
this.PerformLayout();
}
private void Form1_Load_1(object sender, EventArgs e)
{
}
}
}
نظرات شما عزیزان: