SlideShare une entreprise Scribd logo
1  sur  9
A,a,B,b


#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    char abecedario [1][1][2][14];
    printf("letras mayusculas del alfabeton");
    int R,C,R1,C1;


    for(R=0;R<1; R++)
    {
    for(C=0;C<1;C++)
    {
    for(R1=0; R1<2; R1++)
    {
    for(C1=0; C1<14; C1++)
    {
    fflush(stdin);
    printf("n teclee el abecedario:[%d][%d][%d][%d]: n",R,C,R1,C1);
    scanf("%c",&abecedario[R][C][R1][C1]);
    fflush(stdin);

}
}
}
}

printf("n");

printf("abecedario: n",R,C,R1,C1);




for(R=0; R<1; R++)
{
for(C=0; C<1
; C++)
{
for(R1=0; R1<2; R1++)
{
for(C1=0; C1<14; C1++)
{

}
}
}
}
printf("%c",abecedario[R][C][R1][C1]);

    system("PAUSE");
    return 0;
}


Abecedario
#include <iostream>
#include <stdio.h>

using namespace std;


int main()
{

char abecedario[2][2][28][1];
char R,C,R1,C1;

printf("abecedario[PRIMERA][SEGUNDA][TERCERA][CUARTA]n");

for   (R=0; R<2; R++)
{
for   (C=0; C<2; C++)
{
for   (R1=0; R1<28; R1++)
{
for   (C1=0; C1<1; C1++)
}
}

printf("abecedario[%c][%c][%c][%c]: n",R,C,R1,C1);
scanf("%c",&abecedario[R][C][R1][C1]);
}
printf("n");
}
}
for (R=0; R<1; R++)
{
for (C=0; C<1; C++)
{
for (R1=0; R1<1; R1++)
{
for (C1=0; C1<1; C1++)
printf("%c",abecedario[R][C][R1][C1]);
}
printf("n");
}
}




system ("PAUSE");
return 0;
}




Arreglo Unidimensional


#include <iostream> /* LIBRERIAS*/
#include <stdio.h>

int main() /* FUNCION FUENTE*/


{
int suma[5];
int J;

for (J=0; J<=4; J++);
{
printf("el valor de [%d]",J+1);
scanf("%d",&suma[J]);
}

suma[5] = suma [2]+ suma[3];
        printf("el valor de [5] [%d]",suma [5]);




 system ("pause");
 return 0;
}

Arreglo

#include <stdio.h>
#include <iostream>



int main();

{
int Numeros[4][5]; int Ren,Col;
printf("nLEE E IMPRIME NUMEROS EN UNA MATRIZn");
for (Ren=0; Ren<=3; Ren++)
{
for (Col=0; Col<=4; Col++)
{
printf("TECLEE EL VALOR [%d][%d]: ",Ren,Col); Scanf("%d",&Numeros[Ren][Col]);
}
}
printf(" M A T R I Znn");
for (Ren=0; Ren<=3; Ren++)
{
for (Col=0; Col<=4; Col++)
{
printf("%5d ",Numeros[Ren][Col]);
}
printf("n");
}
printf("nPRESIONE <Intro> PARA CONTINUAR..."); fflush(stdin); getchar();
}


Arreglo Tridimencional


#include <iostream>
#include <stdio.h>

using namespace std;


int main()
{
int Numeros[4][5][5]; int Pri,Ren,Col;
printf("nLEE NUMEROS EN UN ARREGLO TRIDIMENSIONALn");
printf(" Y LOS IMPRIME EN LA PANTALLAn"); printf("NUMEROS[PRIMERA][SEGUNDA]
[TERCERA]n");
for (Pri=0; Pri<4; Pri++)
{
for (Ren=0; Ren<5; Ren++)
{
for (Col=0; Col<5; Col++)
{
printf("NUMERO[%d][%d][%d]: ",Pri,Ren,Col); scanf("%d",&Numeros[Pri][Ren][Col]);
}
printf("n");
}
}
for (Pri=0; Pri<4; Pri++)
{
printf("nn------------MATRIZ %d ------------n",Pri);
for (Ren=0; Ren<5; Ren++)
{
for (Col=0; Col<5; Col++)
{
printf("%4d ",Numeros[Pri][Ren][Col]);
}
printf("n");
}
}
printf("nPRESIONE <Intro> PARA CONTINUAR..."); fflush(stdin); getchar();
system ("pause");
return 0;
}

Arreglo


#include <stdio.h>
#include <iostream>

using namespace std;

int main   ()

{

    char vocales [10] ={'a','e','i','o','u','A','E','I','O','U'};

    int Rangos[6][2]= {1,10,
                      11,20,
                      21,30,
                      31,40,
                      41,50,
                      51,60};

    float Z[10]={12.5,3.25,1.5,34.67,7.6,4.0,89.6,4.5,9.0,19.5};
    int R,C;
    printf ("n Inicia arreglos con valores especificos n");
    printf ("-------------------- nn");

    printf ("Arreglo iniciado de vocales n n");
    for (R=0; R<10; R++)
    printf ("%c,",vocales[R]);

    printf("nn Arreglo inciado de Rangos nn");
    for (R=0; R<6; R++)
    {
    for (C=0; C<2;C++)
printf ("%3d",Rangos [R][C]);
     printf("n");
     }
     printf("n n Arreglo inciado de numeros reales n n");
     for(R=0; R<10; R++)
     printf("%5.2f",Z[R]);
     printf("n n");

     system("PAUSE");
     return 0;
}

Auto y responsables


#include <iostream>
#include <cstdlib>

using namespace std;

int main()
{

    char car[2][2];
    int own [2][2];
    int R,C,R1,C1;

    for(R=0;R<=1;R++)
    {
    for(C=0;C<=1;C++)
    {
    printf("nCual es la marca del auto? [%c][%c]:",R,C);
    scanf("%c",&car[R][C]);
    }
    }
    for(R1=0; R1<=1; R1++)
    {
    for(C1=0;C1<=1;C1++)
    {
    printf("Numero de Responssable [%d][%d]:",R1,C1);
    scanf("%d",&own[R1][C1]);
    }
    }

 system ("pause");
 return 0;
 }

Perro


#include <iostream>


using namespace std;


     class
     {
             public :
                    perro (int initialAge);
                    ~perro();
                    int GetAge ()
{
                       return itsAge;
                       }
                       void SetAge (int age)
                       {
                            itsAge = age;
                            }
                            void Ladra ()
                            {
                                 cout <<"Guau Guau... n";
                                 }

                                 private:
                                         int itsAge;
                                         };


Practica final

#include <stdlib.h>
#include <iostream>



int main()
{
    char alfabeto [1][2][4][7];
    printf("letras mayusculas del alfabeton");
    int re,ce,r,c;
    for(re=0;re<1;re++)
    {
                     for(ce=0;ce<2;ce++)
                     {
                                      for(r=0;r<4;r++)
                                       {
                                                       for(c=0;c<7;c++)
                                                       {
                                                            printf("introdusca
las letras del alfaveto[%d][%d][%d][%d] : n",re,ce,r,c);
                                                            scanf("%c",&alfabeto
[re][ce][r][c]);
                                                           fflush(stdin);
                                                            }
                                                              }
                                                              }
                                                              }

                                                                    printf(" n");
                                                                    printf("las letras
en el alfabeto son : n");

for(re=0;re<=1;re++)
    {
                       for(ce=0;ce<2;ce++)
                       {
                                        for(r=0;r<4;r++)
                                         {
                                                           for(c=0;c<7;c++)
                                                           {

printf("%c",alfabeto[re][ce][r][c]);

                                                                }
                                                                 }
}
                                                                }

    system("PAUSE");
    return EXIT_SUCCESS;
}


Practica Perro


#include "Perro.hpp"

perro::perro (int initialAge)
{
             itsAge= initialAge;
             }
             perro::~perro()
             {
                             cout<<"objeto destruido"<< endl;
                             }


int main ()
{
    bool test = false;
    perro Canelo (5);
    Canelo.Ladra();
    cout<<"Canelo es un perro cuya edad es:";
    cout<<Canelo.GetAge ()<< "añosn";

    Canelo.Ladra ();
    Canelo.SetAge (7);
    cout<<"Ahora Canelo tiene";
    cout<<Canelo.GetAge()<<"añosn n";

    system ("PAUSE");
    return 0;
}


Prueba


#include <iostream>
#include <stdio.h>

using namespace std;


int main()
{

int Numeros[4][5][5]; int Pri,Ren,Col;
printf("nLEE NUMEROS EN UN ARREGLO TRIDIMENSIONALn");
printf(" Y LOS IMPRIME EN LA PANTALLAn"); printf("NUMEROS[PRIMERA][SEGUNDA]
[TERCERA]n");
for (Pri=0; Pri<4; Pri++)
{
for (Ren=0; Ren<5; Ren++)
{
for (Col=0; Col<5; Col++)
{
printf("NUMERO[%d][%d][%d]: ",Pri,Ren,Col); scanf("%d",&Numeros[Pri][Ren][Col]);
}
printf("n");
}
}
for (Pri=0; Pri<4; Pri++)
{
printf("nn------------MATRIZ %d ------------n",Pri);
for (Ren=0; Ren<5; Ren++)
{
for (Col=0; Col<5; Col++)
{
printf("%4d ",Numeros[Pri][Ren][Col]);
}
printf("n");
}
}

system ("PAUSE");
return 0;
}


Taller mecanico

#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
    char aut[2][2];
    int responsable[2][2];
    int R,C,R1,C1;

    printf("matriz de taller");

    for(R=0;R<2; R++)
    {
    for(C=0;C<2;C++)
    {
    printf("n cual es el aut?[%c][%c]:",R,C);
    scanf("%c",&aut[R][C]);
}
}

                              for(R1=0;R1<2;R1++)
                              {
                              for(C1=0;C1<2;C1++)
                              {
                              printf("n numero de responsable[%d][%d]:",R1,C1);
                              scanf("%d",&responsable[R1][C1]);
                              }
                              }



    system("PAUSE");
    return 0;
}


Tridimencional    (suma, divicion,resta y promedio)
#include <stdio.h>
#include <iostream>

using namespace std;

int main()
{
    int numeros [4][5][5];
    int sum, res, mul;
    {
    for (sum=0; sum<4; sum++)
    {
        for (res=0, res<5, res++)
        {
            for (mul=0, mul<5, mul++)
            {

    printf("n teclee los valores [%d] n");
    scanf ("%d",&numeros[sum][res][mul]);
}

numeros[4][5][5]= numeros[4][5][5]+ numeros [4][5][5];
printf ("el valor de numeros [4][5][5] [%d]", numeros [4][5][5];




    system("PAUSE");
    return 0;
}

Contenu connexe

Tendances

Programa 3
Programa 3Programa 3
Programa 3Ansd
 
Ejercicios de programación en C (Estructuras condicionales-Selectivas)
Ejercicios de programación en C (Estructuras condicionales-Selectivas)Ejercicios de programación en C (Estructuras condicionales-Selectivas)
Ejercicios de programación en C (Estructuras condicionales-Selectivas)Maynor Mendoza
 
Instrucciones(raptor, java, c#)
Instrucciones(raptor, java, c#)Instrucciones(raptor, java, c#)
Instrucciones(raptor, java, c#)ariannalizeeth
 
Series Infinitas Convergentes y Divergentes en Geogebra CAS
Series Infinitas Convergentes y Divergentes en Geogebra CASSeries Infinitas Convergentes y Divergentes en Geogebra CAS
Series Infinitas Convergentes y Divergentes en Geogebra CASJose Perez
 
ESTRUCTURAS DE CONTROL: BUCLES EN C++
ESTRUCTURAS DE CONTROL: BUCLES EN C++ESTRUCTURAS DE CONTROL: BUCLES EN C++
ESTRUCTURAS DE CONTROL: BUCLES EN C++die_dex
 
Codificaciones c++
Codificaciones c++Codificaciones c++
Codificaciones c++mario_10
 
Codificaciones c++2011
Codificaciones c++2011Codificaciones c++2011
Codificaciones c++2011mario_10
 
Algorimos básicos para cifrar y descifrar en C# (encriptar y desencriptar)
Algorimos básicos para cifrar y descifrar en C# (encriptar y desencriptar)Algorimos básicos para cifrar y descifrar en C# (encriptar y desencriptar)
Algorimos básicos para cifrar y descifrar en C# (encriptar y desencriptar)José Antonio Sandoval Acosta
 
Unidad vi esp parte 2 procesimientos en plsql y transact sql
Unidad vi esp parte 2 procesimientos en plsql y transact sqlUnidad vi esp parte 2 procesimientos en plsql y transact sql
Unidad vi esp parte 2 procesimientos en plsql y transact sqlTitiushko Jazz
 
Apuntes apuntadores 1 a
Apuntes apuntadores 1 aApuntes apuntadores 1 a
Apuntes apuntadores 1 apabesacv
 
Deber funciones-numero-1
Deber funciones-numero-1Deber funciones-numero-1
Deber funciones-numero-1Brian Durán
 
PresentacióN 4
PresentacióN 4PresentacióN 4
PresentacióN 4pokerpc
 

Tendances (18)

Programa 3
Programa 3Programa 3
Programa 3
 
Ejercicios if en c#
Ejercicios if en c#Ejercicios if en c#
Ejercicios if en c#
 
Ejercicios de programación en C (Estructuras condicionales-Selectivas)
Ejercicios de programación en C (Estructuras condicionales-Selectivas)Ejercicios de programación en C (Estructuras condicionales-Selectivas)
Ejercicios de programación en C (Estructuras condicionales-Selectivas)
 
Instrucciones(raptor, java, c#)
Instrucciones(raptor, java, c#)Instrucciones(raptor, java, c#)
Instrucciones(raptor, java, c#)
 
Series Infinitas Convergentes y Divergentes en Geogebra CAS
Series Infinitas Convergentes y Divergentes en Geogebra CASSeries Infinitas Convergentes y Divergentes en Geogebra CAS
Series Infinitas Convergentes y Divergentes en Geogebra CAS
 
1 er informe
1 er informe1 er informe
1 er informe
 
ESTRUCTURAS DE CONTROL: BUCLES EN C++
ESTRUCTURAS DE CONTROL: BUCLES EN C++ESTRUCTURAS DE CONTROL: BUCLES EN C++
ESTRUCTURAS DE CONTROL: BUCLES EN C++
 
Programaswin32c++
Programaswin32c++Programaswin32c++
Programaswin32c++
 
Codificaciones c++
Codificaciones c++Codificaciones c++
Codificaciones c++
 
Codificaciones c++2011
Codificaciones c++2011Codificaciones c++2011
Codificaciones c++2011
 
Apunfun1
Apunfun1Apunfun1
Apunfun1
 
Shellresumen
ShellresumenShellresumen
Shellresumen
 
C++
C++C++
C++
 
Algorimos básicos para cifrar y descifrar en C# (encriptar y desencriptar)
Algorimos básicos para cifrar y descifrar en C# (encriptar y desencriptar)Algorimos básicos para cifrar y descifrar en C# (encriptar y desencriptar)
Algorimos básicos para cifrar y descifrar en C# (encriptar y desencriptar)
 
Unidad vi esp parte 2 procesimientos en plsql y transact sql
Unidad vi esp parte 2 procesimientos en plsql y transact sqlUnidad vi esp parte 2 procesimientos en plsql y transact sql
Unidad vi esp parte 2 procesimientos en plsql y transact sql
 
Apuntes apuntadores 1 a
Apuntes apuntadores 1 aApuntes apuntadores 1 a
Apuntes apuntadores 1 a
 
Deber funciones-numero-1
Deber funciones-numero-1Deber funciones-numero-1
Deber funciones-numero-1
 
PresentacióN 4
PresentacióN 4PresentacióN 4
PresentacióN 4
 

En vedette

Prototype one v1.0sm
Prototype one v1.0smPrototype one v1.0sm
Prototype one v1.0smsusom139
 
Presentación investen 2015
Presentación investen 2015Presentación investen 2015
Presentación investen 2015girtual
 
Desiring Ecologies: Meaning-Making in the Network Wilderness
Desiring Ecologies: Meaning-Making in the Network WildernessDesiring Ecologies: Meaning-Making in the Network Wilderness
Desiring Ecologies: Meaning-Making in the Network WildernessAndy Fitzgerald
 
Information Design: Coherent Concepts for Connected Ecologies
Information Design: Coherent Concepts for Connected EcologiesInformation Design: Coherent Concepts for Connected Ecologies
Information Design: Coherent Concepts for Connected EcologiesAndy Fitzgerald
 

En vedette (12)

Creation
CreationCreation
Creation
 
Presentacion musica
Presentacion musicaPresentacion musica
Presentacion musica
 
Prototype one v1.0sm
Prototype one v1.0smPrototype one v1.0sm
Prototype one v1.0sm
 
Codigos de programas
Codigos de programasCodigos de programas
Codigos de programas
 
Codigos de programas
Codigos de programasCodigos de programas
Codigos de programas
 
Presentación investen 2015
Presentación investen 2015Presentación investen 2015
Presentación investen 2015
 
Desiring Ecologies: Meaning-Making in the Network Wilderness
Desiring Ecologies: Meaning-Making in the Network WildernessDesiring Ecologies: Meaning-Making in the Network Wilderness
Desiring Ecologies: Meaning-Making in the Network Wilderness
 
Scala Higher Order Functions
Scala Higher Order FunctionsScala Higher Order Functions
Scala Higher Order Functions
 
Taxonomy for App Makers
Taxonomy for App MakersTaxonomy for App Makers
Taxonomy for App Makers
 
Practicas c++
Practicas c++Practicas c++
Practicas c++
 
presentation on LIC company
presentation on LIC companypresentation on LIC company
presentation on LIC company
 
Information Design: Coherent Concepts for Connected Ecologies
Information Design: Coherent Concepts for Connected EcologiesInformation Design: Coherent Concepts for Connected Ecologies
Information Design: Coherent Concepts for Connected Ecologies
 

Similaire à Practicas c++

Similaire à Practicas c++ (20)

Include
IncludeInclude
Include
 
Cadenas y punteros.ppt
Cadenas y punteros.pptCadenas y punteros.ppt
Cadenas y punteros.ppt
 
Ejemplos de algoritmos en C básicos (aprendiendo a programar)
Ejemplos de algoritmos en C básicos (aprendiendo a programar)Ejemplos de algoritmos en C básicos (aprendiendo a programar)
Ejemplos de algoritmos en C básicos (aprendiendo a programar)
 
Ejemplos java
Ejemplos javaEjemplos java
Ejemplos java
 
Corridas de los ejercicios ya realizados
Corridas de los ejercicios ya realizadosCorridas de los ejercicios ya realizados
Corridas de los ejercicios ya realizados
 
Rubenmajano
RubenmajanoRubenmajano
Rubenmajano
 
Algoritmos Secuenciales
Algoritmos Secuenciales Algoritmos Secuenciales
Algoritmos Secuenciales
 
PROGRAMAS C++
PROGRAMAS C++PROGRAMAS C++
PROGRAMAS C++
 
1... conversor de bases
1... conversor de bases1... conversor de bases
1... conversor de bases
 
Laboratorio1 entrada-salida de datos / Lenguance C
Laboratorio1   entrada-salida de datos / Lenguance CLaboratorio1   entrada-salida de datos / Lenguance C
Laboratorio1 entrada-salida de datos / Lenguance C
 
Ejerciciosprogramacion
EjerciciosprogramacionEjerciciosprogramacion
Ejerciciosprogramacion
 
ESTRUCTURAS ARRAYS Y DATOS C++
ESTRUCTURAS ARRAYS Y DATOS C++ESTRUCTURAS ARRAYS Y DATOS C++
ESTRUCTURAS ARRAYS Y DATOS C++
 
Estructura de datos
Estructura de datosEstructura de datos
Estructura de datos
 
Universidad técnica de ambato
Universidad técnica de ambatoUniversidad técnica de ambato
Universidad técnica de ambato
 
Ejercicios de programación.
Ejercicios de programación.Ejercicios de programación.
Ejercicios de programación.
 
Tra 130315111309-phpapp02
Tra 130315111309-phpapp02Tra 130315111309-phpapp02
Tra 130315111309-phpapp02
 
Tra
TraTra
Tra
 
algoritmos y Programacion
algoritmos y Programacionalgoritmos y Programacion
algoritmos y Programacion
 
Informe tecnico
Informe tecnicoInforme tecnico
Informe tecnico
 
Eliminacion Gaussiana en C
Eliminacion Gaussiana en CEliminacion Gaussiana en C
Eliminacion Gaussiana en C
 

Practicas c++

  • 1. A,a,B,b #include <cstdlib> #include <iostream> using namespace std; int main() { char abecedario [1][1][2][14]; printf("letras mayusculas del alfabeton"); int R,C,R1,C1; for(R=0;R<1; R++) { for(C=0;C<1;C++) { for(R1=0; R1<2; R1++) { for(C1=0; C1<14; C1++) { fflush(stdin); printf("n teclee el abecedario:[%d][%d][%d][%d]: n",R,C,R1,C1); scanf("%c",&abecedario[R][C][R1][C1]); fflush(stdin); } } } } printf("n"); printf("abecedario: n",R,C,R1,C1); for(R=0; R<1; R++) { for(C=0; C<1 ; C++) { for(R1=0; R1<2; R1++) { for(C1=0; C1<14; C1++) { } } } } printf("%c",abecedario[R][C][R1][C1]); system("PAUSE"); return 0; } Abecedario
  • 2. #include <iostream> #include <stdio.h> using namespace std; int main() { char abecedario[2][2][28][1]; char R,C,R1,C1; printf("abecedario[PRIMERA][SEGUNDA][TERCERA][CUARTA]n"); for (R=0; R<2; R++) { for (C=0; C<2; C++) { for (R1=0; R1<28; R1++) { for (C1=0; C1<1; C1++) } } printf("abecedario[%c][%c][%c][%c]: n",R,C,R1,C1); scanf("%c",&abecedario[R][C][R1][C1]); } printf("n"); } } for (R=0; R<1; R++) { for (C=0; C<1; C++) { for (R1=0; R1<1; R1++) { for (C1=0; C1<1; C1++) printf("%c",abecedario[R][C][R1][C1]); } printf("n"); } } system ("PAUSE"); return 0; } Arreglo Unidimensional #include <iostream> /* LIBRERIAS*/ #include <stdio.h> int main() /* FUNCION FUENTE*/ {
  • 3. int suma[5]; int J; for (J=0; J<=4; J++); { printf("el valor de [%d]",J+1); scanf("%d",&suma[J]); } suma[5] = suma [2]+ suma[3]; printf("el valor de [5] [%d]",suma [5]); system ("pause"); return 0; } Arreglo #include <stdio.h> #include <iostream> int main(); { int Numeros[4][5]; int Ren,Col; printf("nLEE E IMPRIME NUMEROS EN UNA MATRIZn"); for (Ren=0; Ren<=3; Ren++) { for (Col=0; Col<=4; Col++) { printf("TECLEE EL VALOR [%d][%d]: ",Ren,Col); Scanf("%d",&Numeros[Ren][Col]); } } printf(" M A T R I Znn"); for (Ren=0; Ren<=3; Ren++) { for (Col=0; Col<=4; Col++) { printf("%5d ",Numeros[Ren][Col]); } printf("n"); } printf("nPRESIONE <Intro> PARA CONTINUAR..."); fflush(stdin); getchar(); } Arreglo Tridimencional #include <iostream> #include <stdio.h> using namespace std; int main() { int Numeros[4][5][5]; int Pri,Ren,Col; printf("nLEE NUMEROS EN UN ARREGLO TRIDIMENSIONALn");
  • 4. printf(" Y LOS IMPRIME EN LA PANTALLAn"); printf("NUMEROS[PRIMERA][SEGUNDA] [TERCERA]n"); for (Pri=0; Pri<4; Pri++) { for (Ren=0; Ren<5; Ren++) { for (Col=0; Col<5; Col++) { printf("NUMERO[%d][%d][%d]: ",Pri,Ren,Col); scanf("%d",&Numeros[Pri][Ren][Col]); } printf("n"); } } for (Pri=0; Pri<4; Pri++) { printf("nn------------MATRIZ %d ------------n",Pri); for (Ren=0; Ren<5; Ren++) { for (Col=0; Col<5; Col++) { printf("%4d ",Numeros[Pri][Ren][Col]); } printf("n"); } } printf("nPRESIONE <Intro> PARA CONTINUAR..."); fflush(stdin); getchar(); system ("pause"); return 0; } Arreglo #include <stdio.h> #include <iostream> using namespace std; int main () { char vocales [10] ={'a','e','i','o','u','A','E','I','O','U'}; int Rangos[6][2]= {1,10, 11,20, 21,30, 31,40, 41,50, 51,60}; float Z[10]={12.5,3.25,1.5,34.67,7.6,4.0,89.6,4.5,9.0,19.5}; int R,C; printf ("n Inicia arreglos con valores especificos n"); printf ("-------------------- nn"); printf ("Arreglo iniciado de vocales n n"); for (R=0; R<10; R++) printf ("%c,",vocales[R]); printf("nn Arreglo inciado de Rangos nn"); for (R=0; R<6; R++) { for (C=0; C<2;C++)
  • 5. printf ("%3d",Rangos [R][C]); printf("n"); } printf("n n Arreglo inciado de numeros reales n n"); for(R=0; R<10; R++) printf("%5.2f",Z[R]); printf("n n"); system("PAUSE"); return 0; } Auto y responsables #include <iostream> #include <cstdlib> using namespace std; int main() { char car[2][2]; int own [2][2]; int R,C,R1,C1; for(R=0;R<=1;R++) { for(C=0;C<=1;C++) { printf("nCual es la marca del auto? [%c][%c]:",R,C); scanf("%c",&car[R][C]); } } for(R1=0; R1<=1; R1++) { for(C1=0;C1<=1;C1++) { printf("Numero de Responssable [%d][%d]:",R1,C1); scanf("%d",&own[R1][C1]); } } system ("pause"); return 0; } Perro #include <iostream> using namespace std; class { public : perro (int initialAge); ~perro(); int GetAge ()
  • 6. { return itsAge; } void SetAge (int age) { itsAge = age; } void Ladra () { cout <<"Guau Guau... n"; } private: int itsAge; }; Practica final #include <stdlib.h> #include <iostream> int main() { char alfabeto [1][2][4][7]; printf("letras mayusculas del alfabeton"); int re,ce,r,c; for(re=0;re<1;re++) { for(ce=0;ce<2;ce++) { for(r=0;r<4;r++) { for(c=0;c<7;c++) { printf("introdusca las letras del alfaveto[%d][%d][%d][%d] : n",re,ce,r,c); scanf("%c",&alfabeto [re][ce][r][c]); fflush(stdin); } } } } printf(" n"); printf("las letras en el alfabeto son : n"); for(re=0;re<=1;re++) { for(ce=0;ce<2;ce++) { for(r=0;r<4;r++) { for(c=0;c<7;c++) { printf("%c",alfabeto[re][ce][r][c]); } }
  • 7. } } system("PAUSE"); return EXIT_SUCCESS; } Practica Perro #include "Perro.hpp" perro::perro (int initialAge) { itsAge= initialAge; } perro::~perro() { cout<<"objeto destruido"<< endl; } int main () { bool test = false; perro Canelo (5); Canelo.Ladra(); cout<<"Canelo es un perro cuya edad es:"; cout<<Canelo.GetAge ()<< "añosn"; Canelo.Ladra (); Canelo.SetAge (7); cout<<"Ahora Canelo tiene"; cout<<Canelo.GetAge()<<"añosn n"; system ("PAUSE"); return 0; } Prueba #include <iostream> #include <stdio.h> using namespace std; int main() { int Numeros[4][5][5]; int Pri,Ren,Col; printf("nLEE NUMEROS EN UN ARREGLO TRIDIMENSIONALn"); printf(" Y LOS IMPRIME EN LA PANTALLAn"); printf("NUMEROS[PRIMERA][SEGUNDA] [TERCERA]n"); for (Pri=0; Pri<4; Pri++) { for (Ren=0; Ren<5; Ren++) { for (Col=0; Col<5; Col++) { printf("NUMERO[%d][%d][%d]: ",Pri,Ren,Col); scanf("%d",&Numeros[Pri][Ren][Col]);
  • 8. } printf("n"); } } for (Pri=0; Pri<4; Pri++) { printf("nn------------MATRIZ %d ------------n",Pri); for (Ren=0; Ren<5; Ren++) { for (Col=0; Col<5; Col++) { printf("%4d ",Numeros[Pri][Ren][Col]); } printf("n"); } } system ("PAUSE"); return 0; } Taller mecanico #include <cstdlib> #include <iostream> using namespace std; int main() { char aut[2][2]; int responsable[2][2]; int R,C,R1,C1; printf("matriz de taller"); for(R=0;R<2; R++) { for(C=0;C<2;C++) { printf("n cual es el aut?[%c][%c]:",R,C); scanf("%c",&aut[R][C]); } } for(R1=0;R1<2;R1++) { for(C1=0;C1<2;C1++) { printf("n numero de responsable[%d][%d]:",R1,C1); scanf("%d",&responsable[R1][C1]); } } system("PAUSE"); return 0; } Tridimencional (suma, divicion,resta y promedio)
  • 9. #include <stdio.h> #include <iostream> using namespace std; int main() { int numeros [4][5][5]; int sum, res, mul; { for (sum=0; sum<4; sum++) { for (res=0, res<5, res++) { for (mul=0, mul<5, mul++) { printf("n teclee los valores [%d] n"); scanf ("%d",&numeros[sum][res][mul]); } numeros[4][5][5]= numeros[4][5][5]+ numeros [4][5][5]; printf ("el valor de numeros [4][5][5] [%d]", numeros [4][5][5]; system("PAUSE"); return 0; }