lunes, 11 de junio de 2012

Programas en Visual Basic (Pasa de Horas a Minutos y Segundos)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    Private Sub text1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles text1.TextChanged
    End Sub
    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        text2.Text = Val(text1.Text) * 60
        text3.Text = Val(text1.Text) * 60 * 60
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        End
    End Sub
End Class


Programas Visual Basic (Multiplicacion y Divicion)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        text3.Text = Val(text1.Text) * Val(text2.Text)
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        text3.Text = Val(text1.Text) / Val(text2.Text)
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        text1.Text = ""
        text2.Text = ""
        text3.Text = ""
    End Sub
    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        End
    End Sub
End Class

Multiplicacion
Multiplicaciòn

Progrmas en Visual Basic (Suma y Resta)

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        text3.text = Val(text1.text) + Val(text2.text)
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        text3.Text = Val(text1.Text) - Val(text2.Text)
    End Sub
    Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
        text1.Text = ""
        text2.Text = ""
        text3.Text = ""
    End Sub
    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        End
    End Sub
  
End Class

Suma

Resta



miércoles, 30 de mayo de 2012

Programas con Arreglos

Arreglo 1

#include<stdio.h>
#include<conio.h>
void main ()
{
int f,g=0;
int h[15]={0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
for(f=0; f<15; f++)
if((h[f]%2)==0)
printf("Es par\n");
else
{
printf("Es impar\n");
}
printf("pause");
getch(0);

}




Arreglo 2
#include<stdio.h>

#include<stdlib.h>
  void main()
{
       int f, g=0;
       int h[5]={0,1,2,3,4};
       for (f=0; f<5; f++)
       g+=h[f];
       printf("%d\n",g);
       system ("pause");
  }


Arreglo 3

#include<stdio.h>
#include<stdlib.h>
  void main()
{
       int f,g=0;
       int h[10]={0,1,2,3,4,5,6,7,8,9};
       for(f=0; f<10 ;f++)
             if ((h[f]%2)==0)
                    printf("el numero par\n ");
             else
             {
                    printf(" el numero impar \n");
             }
             system ("pause");
             return ;
}



 Arreglo 4

#include<stdio.h>
#include<stdlib.h>
void main ()
{
       int a, b=0;
       int c[10]={1,2,3,4,5,6,7,8,9,0};
       for (a=0; a<10; a++)
       if ((c[a] %2) ==0)
             b+=c[a];
       printf ("%d",&b);
       system ("pause");
       return (0);
}