0% found this document useful (0 votes)
3 views2 pages

C# Windows Forms: Max, Prime, Factorization

The document is a C# Windows Forms application that includes a form with functionalities to find the maximum of three numbers, check if a number is prime, and factorize a number into its prime factors. It contains event handlers for button clicks that perform these calculations and display the results in designated text boxes. Additionally, there is a button to clear all input and output fields.

Uploaded by

Sabrina
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)
3 views2 pages

C# Windows Forms: Max, Prime, Factorization

The document is a C# Windows Forms application that includes a form with functionalities to find the maximum of three numbers, check if a number is prime, and factorize a number into its prime factors. It contains event handlers for button clicks that perform these calculations and display the results in designated text boxes. Additionally, there is a button to clear all input and output fields.

Uploaded by

Sabrina
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

using System;

using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];
using [Link];

namespace BRAN
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)


{
int a, b, c,maxi;
a = [Link]([Link]);
b = [Link]([Link]);
c = [Link]([Link]);
if (a > b)
maxi = a;
else
maxi = b;
if (c > maxi)
maxi = c;
[Link] = [Link]();
}

private void button2_Click(object sender, EventArgs e)


{
int c = [Link]([Link]);
int ok = 1;
for(int i=2;i*i<=c&&ok==1;i++)
if (c % i == 0)
ok = 0;
if (ok == 1)
[Link] = "Numarul este prim";
else
[Link] = "Numarul nu este prim";

private void button3_Click(object sender, EventArgs e)


{
int b = [Link]([Link]);
int d = 2, fm = 0;
string rez = "";
while (b > 1)
{
while (b % d == 0)
{
b = b / d;
fm++;
}
if (fm != 0)
{
rez = rez + [Link]() + " la " + [Link]() +
";";
}
d++;
fm = 0;
}
[Link] = rez;
}

private void button4_Click(object sender, EventArgs e)


{
[Link] = "";
[Link] = "";
[Link] = "";
[Link] = "";
[Link] = "";
[Link] = "";
}
}
}

You might also like