-
-
Save tapajos/369148 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Calculos | |
{ | |
public partial class Form1 : Form | |
{ | |
public Form1() | |
{ | |
InitializeComponent(); | |
} | |
private void textBox2_TextChanged(object sender, EventArgs e) | |
{ | |
} | |
private void btnlimpar_Click(object sender, EventArgs e) | |
{ | |
txbvalor.Clear(); | |
txbresposta.Clear(); | |
} | |
private void btncalcular_Click(object sender, EventArgs e) | |
{ | |
Int32 valor; | |
Int32 resto; | |
txbresposta.Text = (""); | |
valor = Convert.ToInt32(txbvalor.Text); | |
{ | |
resto = valor % 2; | |
if (resto == 0) | |
txbresposta.Text += ("Este número é par"); | |
else txbresposta.Text += ("Este número é ímpar"); | |
} | |
{ | |
resto = valor % 3; | |
if (resto == 0) | |
txbresposta.Text += ("Este número é múltiplo de 3"); | |
else txbresposta.Text += ("Este número não é múltiplo de 3"); | |
} | |
{ | |
resto = valor % 4; | |
if (resto == 0) | |
txbresposta.Text += ("Este número é múltiplo de 4"); | |
else txbresposta.Text += ("Este número não é múltiplo de 4"); | |
} | |
{ | |
resto = valor % 5; | |
if (resto == 0) | |
txbresposta.Text += ("Este número é múltiplo de 5"); | |
else txbresposta.Text += ("Este número não é múltiplo de 5"); | |
} | |
{ | |
resto = valor % 7; | |
if (resto == 0) | |
txbresposta.Text += ("Este número é múltiplo de 7"); | |
else txbresposta.Text += ("Este número não é múltiplo de 7"); | |
} | |
{ | |
if ((valor >= 0) && (valor <= 100)) | |
txbresposta.Text += ("Este número está entre 0 e 100"); | |
else txbresposta.Text += ("Este número não está entre 0 e 100"); | |
} | |
{ | |
if (valor > 100) | |
txbresposta.Text += ("Este número é maior que 100"); | |
else txbresposta.Text += ("Este número é menor que 100"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment