0% found this document useful (0 votes)
39 views1 page

DNM 2

The document defines a struct called ehliyet_sınav_sonuc to store a driving exam candidate's name, age, score, grade, and pass/fail result. It then creates an array of this struct, populates it by reading input from the console, and outputs the stored data.

Uploaded by

Su
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)
39 views1 page

DNM 2

The document defines a struct called ehliyet_sınav_sonuc to store a driving exam candidate's name, age, score, grade, and pass/fail result. It then creates an array of this struct, populates it by reading input from the console, and outputs the stored data.

Uploaded by

Su
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

ukşş

namespace structs
{
class Program
{
struct ehliyet_sınav_sonuc
{
public string string1;
public int int1;
public double double1;
public char char1;
public bool bool1;
}
static void Main(string[] args)
{
ehliyet_sınav_sonuc[] array = new ehliyet_sınav_sonuc[1];
for (int i = 0; i < array.LongLength; i++)
{
Console.WriteLine("aday adı:");
array[i].string1 = Console.ReadLine();
Console.WriteLine("aday yası:");
array[i].int1 =Convert.ToInt16(Console.ReadLine());
Console.WriteLine("aday puanı:");
array[i].double1 = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("aday notu:");
array[i].char1 = Convert.ToChar(Console.ReadLine());
if(array[i].double1>80.0)
array[i].bool1 = true;
else
array[i].bool1 = false;
}
for(int i=0;i<array.LongLength;i++)
Console.Write(array[i].string1 +" "+ array[i].int1 +" "+ array[i].double1
+" "+ array[i].char1 +" "+ array[i].bool1);
}
}
}

You might also like