using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace PruebaSgfGlobalManuelSilva { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { for (int i = 1; i < 101; i++) { Comparar(i); } MessageBox.Show("Listo"); } public void Comparar(int n) { if (n % 3 == 0) { if (n % 5 == 0) { //textBox1.Text = textBox1.Text + System.Environment.NewLine + "FuzzBazz "; System.Diagnostics.Debug.WriteLine("FuzzBazz "); } else { //textBox1.Text = textBox1.Text + System.Environment.NewLine + "Bazz "; System.Diagnostics.Debug.WriteLine("Bazz"); } } else { //nada //textBox1.Text += textBox1.Text + System.Environment.NewLine + n.ToString(); if (n % 5 == 0) { //textBox1.Text = textBox1.Text + System.Environment.NewLine + "Fuzz "; System.Diagnostics.Debug.WriteLine("Fuzz"); } else { System.Diagnostics.Debug.WriteLine(n.ToString()); } } } private void Form1_Load(object sender, EventArgs e) { } } }