0% found this document useful (0 votes)
45 views

Array Multidimensional

This document defines a multi-dimensional string array with 3 rows and 5 columns to store student names, scores, and IDs. It takes a name from a text box, searches the array to find the matching name, and outputs the corresponding score and ID to another text box.

Uploaded by

Rika Sulastri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Array Multidimensional

This document defines a multi-dimensional string array with 3 rows and 5 columns to store student names, scores, and IDs. It takes a name from a text box, searches the array to find the matching name, and outputs the corresponding score and ID to another text box.

Uploaded by

Rika Sulastri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Array multidimensional :

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()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
string[,] ar = new string[3, 5] { { "rika", "selly", "khofifah",
"fadhilla", "rada" }, { "90", "80", "70", "95", "88" }, { "1", "2", "3", "4", "5" } };
string f = textBox1.Text;
for (int j = 0; j < 5; j++)
{
if (f == ar[0, j])
{
textBox2.Text = "nilai=" + ar[1, j] + Environment.NewLine + "id="
+ ar[2, j];
break;
}
}
}
}
}

You might also like