Codificaciones c++2011
CODIFICACION Nº 1

//PROGRMA PARA LLENAR EL VECTOR DE LOS 10 PARES Y
INPARES

#include < iostream.h >

#include <conio.h>

#include <stdio.h>

void main()

{

     int num[10]

     int i,int j;



     for(i=2;i<=20;i=i+2)

     cout<<"numero pares:"<<i<<endl;

     cin>>num[i];

     gotoxy(1,12);



     for(j=1;j<=20;j=j+2)

     cout<<"numero impares:"<<j<<endl;

     cin>>num[j];

     getch();

}
CODIFICACION Nº 2
//PROGRMA del vector de los 10 elementos con 1,2


autor luis daquilema 6to informatica


#include <stdio.h>


#include <conio.h>


#include <iostream.h>


void main()


{


        int n[10],i,j;


        cout<<"progrma del vector con elemnto 1,2:"<<endl;


        for(i=1;i<10;i++)


                  {


                            if(i%2==0)


                                      n[i]=2;


                            else


                                      n[i]=1;


                  }


                  for(j=1;j<10;j++)


                  {


                            cout<<n[j]<<endl;


                  }
getch();


}


                                  CODIFICACION Nº 3
//PROGRMA del vector de los 10 elementos con 1,2,3,4,5 y 1,2,3,4,5


//autor luis daquilema 6to informatica


#include <iostream.h>


#include <conio.h>


#include <stdio.h>


void main()


{


        int num[2];


        int n,nu,i=0; int j=0;


        cout<<"progrma del vector con elemnto 1,2,3,4,5:"<<endl;


        for(i=1;i<=5;i++)


                   {


                                 cout<<"el vector es:"<<i<<endl;


                   }




        for(j=1;j<=5;j=j+1)


                   {


                                 cout<<"el vector es:"<<j<<endl;
}


        getch();


}


                                    CODIFICACION Nº 4
//PROGRMA DEL VECTOR DE SOLO CON EL NUMERO 1


//autor luis daquilema 6to informatica


#include <iostream.h>


#include <conio.h>


#include <stdio.h>


void main()


{


        int num[1],i=10;


        cout<<"progrma del vector con elemnto 1:"<<endl;


        do{


                   cout<<"progrma del vector con elemnto 1:"<<endl;


                   cout<<1<<endl;


                   i++;


                   }while(i<=num[10]);


        getch();


}


                                    CODIFICACION Nº 5
//PROGRMA DEL VECTOR DE LOS NUMEROS PARES


//autor luis daquilema 6to informatica


#include <iostream.h>


#include <conio.h>


#include <stdio.h>


void main()


{


        int par[10];


        int impar[10];


        cout<<"PROGRAMA DEL VECTOR DE LOS NUMEROPS PARES:"<<endl;


        int i; int j;int x;int num;int sumpar;


        sumpar=0;


        for(i=1;i<=10;i++)


        {


                          cout<<"INGRESE NUMERO:"<<i<<endl;


                          cin>>num;


                          par[i]=num;


        }


        cout<<"EL CONTENIDO DEL VECTOR ES :"<<endl;


        for(j=1;j<=10;j++)


                          cout<<par[j]<<endl;
getch();


    for(x=1;x<=10;x++)


                   if(par[x]%2==0)


                           sumpar=sumpar+par[x];


    cout<<"la suma de los numeros pares es:"<<sumpar<<endl;


    getch();


}
CODIFICACION Nº 6
//PROGRMA DEL VECTOR DE LOS NUMEROS PARES E IMPARES HASTA EL 20


//autor luis daquilema 6to informatica


#include <iostream.h>


#include <conio.h>


#include <stdio.h>


void main()


{


        float num[10];


        float num1[10];


        int i; int j;


        cout<<"porgrama de los numeros pares e impares hasta el 20:"<<i<<endl;




        for(i=2;i<=20;i=i+2)


        cout<<"los numeros pares hasta el 20:"<<i<<endl;


        gotoxy(1,14);




        for(j=1;j<=20;j=j+2)


        cout<<"los numeros impares hasta el 20:"<<j<<endl;


        cin>>num1[j];


        getch();
}




                                  CODIFICACION Nº 7
//programa para sumar los numeros impares


//autor luis daquilema 6to informatica


# include<iostream.h>


# include<stdio.h>


# include<conio.h>


void main()


{




        cout<<"programa para sumar los numeros impares"<<endl;


        int numero[10];int num;int i;


        for(i=1;i<=10;i++)




        {


        cout<<"ingrese numeros "<<i<<endl;


        cin>>num;


        numero[i]=num;


        }


        for(i=1;i<=10;i++)
{


        cout<<"numeros ingresados ";


        cout<<numero[i]<<endl;


        }


        getch();


}




                                    CODIFICACION Nº 8
//PROGRMA DEL VECTOR DE LOS NUMEROS PARES CONTENIDOS


//autor luis daquilema 6to informatica


#include <iostream.h>


#include <conio.h>


#include <stdio.h>


void main()


{


        int par[10];


        int impar[10];


        cout<<"PROGRAMA DEL VECTOR DE LOS NUMEROPS PARES:"<<endl;


        int i; int j;int x;int num;int sumapares;


        sumapares=0;


        for(i=1;i<=10;i++)
{


                         cout<<"INGRESE NUMERO:"<<i<<endl;


                         cin>>num;


                         par[i]=num;


        }


        cout<<"EL CONTENIDO DEL VECTOR ES :"<<endl;


        for(j=1;j<=10;j++)


                         cout<<par[j]<<endl;


        getch();


        for(x=1;x<=10;x++)


                         if(par[x]%2==0)


                                 sumapares=sumapares+par[x];


        cout<<"la suma de los numeros pares es:"<<sumapares<<endl;


        getch();


}


                                  CODIFICACION Nº 9
//programa la calculadora


//autor Luis daquilema


//6to informatica


#include <iostream.h>


#include <conio.h>
#include <stdio.h>


void main()


{


        int n1,n2,op;


        float r;


        cout<<"autor Luis Daquilema :"<<endl;


        cout<<"programa calculadora:"<<endl;


        cout<<"ingrese numero:";


        cin>>n1;


        cout<<"ingrese numero:";


        cin>>n2;


        cout<<"ingrese opcion:";


        cin>>op;


        if         (op==1)


        {


                   r=n1+n2;


                   cout<<"la suma es:"<<r;


                   getch();


        }


        if         (op==2)


        {
r=n1-n2;


                cout<<"la resta es:"<<r;


                getch();


    }


    if          (op==3)


    {


                r=n1*n2;


                cout<<"la multiplicacion es:"<<r;


                getch();


    }


    if          (op==4)


    {


                r=n1*n2;


                cout<<"la division es:"<<r;


                getch();


    }


    else


    clrscr();


    getch();


    clrscr();


}
CODIFICACION Nº 10

//PROGRAMA DE DATOS DE LOS AMIGOS

//lUIS DAQUILEMA

//SEXTO INFORMATICA

#include <iostream.h>

#include<stdio.h>

#include<conio.h>

#define N 3

void main()

{

      int cont=0;

      char op;



struct agenda

{

      char nombre[50];

      int tel;

      int edad ;

}a [10];

do

{
clrscr();

     cout<<"INGRESE EL NOMBRE DEL AMIGO: ";

     cin>>(a[cont].nombre);

     cout<<endl<<"INGRESE EL NUMERO DE TELEFONO: ";

     cin>>(a[cont].tel) ;

     cout<<endl<<"INGRESE LA EDAD DEL AMIGO: ";

cin>>(a[cont].edad);

cout<<endl<<endl<<"¨QUIERE ALMACENAR OTRO REGISTRO SI O
NO?";

           cin>>op;

           if(op=='S' || op=='s')

           {

                 cont+=1;

           }

           if(op=='N' || op=='n')

           {

                 cont=cont+10;

           }



     }



     while(cont<10);
clrscr();

     cont-=10;

     for(int i=0;i<=cont;i++)

     {

        cout<<"NUMERO DE REGISTRO DE LOS
CONTACTOS:"<<i+1<<endl<<endl;

           cout<<"EL NOMBRE DEL AMIGO ES:
"<<a[i].nombre<<endl<<endl;

            cout<<"EL TELEFONO DEL AMIGO ES:
"<<a[i].tel<<endl<<endl;

           cout<<"SU EDAD ES: "<<a[i].edad<<endl<<endl;

           getch();

     }

     getch();

     }

     {

    cout<<"amigo: "<<amigos[i].nombre<<endl<<"telefono:
"<<amigos[i].telefono<<endl<<"edad: "<<amigos[i].edad<<endl;

}

                      CODIFICACION Nº 11

//PROGRAMA DE REPETICION DE SI O NO DE UN NUMERO

#include <iostream.h>

#include <conio.h>
#include <stdio.h>

void main ()

{

     int n,r;

     char res[2];

     res[0]='s';

     res[1]='i';

     while(res[0]=='s'&&res[1]=='i')

     {

           clrscr();

           cout<<"ingrese un nuero:";

           cin>>n;

           r=n%2;

           res[0]='i';

           while(res[0]=='s'&&res[1]=='i')



                   clrscr();

                   cout<<"ingrese un numero:";

                   ci>>n;

                   r=n%2;

                   if(r==0)
cout<<"Par"<<endl;

                 else

                        cout<<"Impar"<<endl;

                 cout<<"Desea seguir si o no: ";

                 cin>>res;

     }

getch();

}

                        CODIFICACION Nº 12

//PROGRAMA DE UN NUEMRO PAR O IMPAR

#include<iostream.h>

#include<stdio.h>

#include<conio.h>

void main ()

{

     int num;

     gotoxy(8,8);

     cout<<"ingrese un numero:";

     cin>>num;

     if (num%2==0)

                 cout<<"Es Par"<<endl;
else

                       cout<<"Es impar"<<endl;

     getch();

}

                       CODIFICACION Nº 13

//PROGRAMA DE UN NUEMRO MAXIMO

#include<iostream.h>

#include<stdio.h>

#include<conio.h>



int maximo (int n1, int n2)

{

     if(n1>n2)

     return n1;

     else

     return n2;

};

void main ()

{

     int n1, n2;

     int max;
cout<<"ingrese n1:";

      cin>>n1;

      cout<<"ingrese n2:";

      cin>>n2;

      max=maximo(n1,n2);

      cout<<"El nemero mayor es:"<<max;

}

                       CODIFICACION Nº 14

PROGRAMA DE DATOS DE MIS AMIGOS CON FUNCIONES

#include<stdio.h>

#include<iostream.h>

#define n 3



struct agenda

{

    char nombre[25];

       char telefono[10];

       int edad;

      };



struct agenda a[n];
void main()

{

        for(int i=0;i<n;i++)

    {

        cout<<"Ingrese nombre: ";

        cin>>a[i].nombre;

        cout<<"Ingrese edad: ";

        cin>>a[i].edad;

        cout<<"Ingresar telefono: ";

        cin>>a[i].telefono;

        }

        for(int j=0;j<n;j++)

        {

        cout<<"El nombre es "<<a[j].nombre;

        cout<<" su edad es "<<a[j].edad;

        cout<<" y su telefono es "<<a[j].telefono<<endl;

        }

}

                          CODIFICACION Nº 15
//programa del numero mayor con funcion

#include<stdio.h>

#include<iostream.h>

#include<conio.h>



int maximo()

{

int n1, n2;

int max;

cout << "Ingrese n1: ";

cin>>n1;

cout << "Ingrese n2: ";

cin>>n2;

max=(n1,n2);

if(n1>n2)

max=n1;

else

max=n2;

return max;

};
int main()

{

int max;

max=maximo();

cout<<"El numero mayor es:"<< max;

}

                          CODIFICACION Nº 16

//programa de datos de una persona

#include <stdio.h>

#include <conio.h>

#include <iostream.h>



int telefono(int, int);

int edad(int, int);

int res, res3,res2;

int r,r3,r2;

void main()

{




      char nom[50];
char nom1[30];

     int i;int j;

     int n1,n2,res2,res1,res3;

     cout<<"programa de datos de una persona "<<endl;

     int e1,e2,r2,r1,r3;

     int d1,d2,m1,m2,m3;

     for (i=1;i<=2;i++)

     {

     cout<<"ingrese nombre "<<endl;

     }

gotoxy(20,2);

cin>>nom;

gotoxy(20,3);

cin>>nom1;

res1=telefono(n1,n2);

res3=telefono(n1,n2);

r1=edad(e1,e2);

r3=edad(e1,e2);



}

int telefono(int n1,int n2)
{

        cout<<"ingrese telefono: ";

cin>>n1;

res=n1;

return(res);

cout<<"ingrese telefono 2: ";

cin>>n2;

res2=n2;

return(res3);

}

int edad(int e1,int e2)

{

        cout<<"ingrese edad: ";

cin>>e1;

r=e1;

return(r);

cout<<"ingrese edad 2 ";

cin>>e2;

r2=e2;

return(r2);

        getch();
}

                          CODIFICACION Nº 17

//PROGRAMA QUE INGRESA NUMEROS LOS VECTORES Y SUMA
LOS NUMEROS PARES

#include <iostream.h>

#include <conio.h>

#include <stdio.h>

void main()

{

     int par[10];

     int impar[10];

     int i; int j;int x;int num;int sumapares;

     sumapares=0;

     for (i=1;i<=10;i++)

     {

           cout<<"ingrese un numero:"<<i<<endl;

              cin>>num;

              par[i]=num;

     }

     cout<<"El Contenido del vector es:"<<endl;

     for   (j=1; j<=10;j++)

           cout<<par[j]<<endl;
getch();

     for    (x=1;x<=10;x++)

            if (par[x]%2==0)

                    sumapares=sumapares+par[x];

     cout<<"La suma de los numeros pares
es:"<<sumapares<<endl;

     getch();

}

                          CODIFICACION Nº 18

//PROGRAMA QUE INGRESA ELEMENTOS EN UN VETOR

#include <iostream.h>

#include <conio.h>

#include <stdio.h>

void main()

{

     int num[20]

     int i;int j;

     for (i=0;i<=5;i++)

     {

                    cout<<i<<endl;

     }

     cout<<"Elementos ingresados:"<<i<<endl;
getch();

}
                                            CODIFICACION Nº 19

//PROGRAMA LA FRASE

//AUTOR LUIS DAQUILEMA 6to INFORMATICA

#include <iostream.h>

#include <conio.h>

#include <string.h>

int main()

{

        int ma=0,me=0,mi=0,mo=0,mu=0,s=0,t,ar;

        char frase[40];

{

                clrscr();

                cout<<"ingrese la frase:"<<endl;

                cin.getline(frase,40);

                t=strlen(frase);

                cout<<"La frase tiene"<<endl;

        for(int c=0;c<39;c++)

        {

                if (frase[c]=='a')

                                     ma++;

                                     else

                                                    if (frase[c]=='e')

                                                             me++;

                                                             else

                                                             if(frase[c]=='i')
mi++;

                                                          else

                                                          f (frase[c]=='o')

                                                                  mo++;

                                                                  else

                                                                  if (frase[c]=='u')

                                                                              mu++;

                                                                              else

                                                                              if(frase[c]==' ')

                                                                                       s++;

       }

       cout<<"el total A:"<<ma<<endl;

       cout<<"el total E:"<<me<<endl;

       cout<<"el total I:"<<mi<<endl;

       cout<<"el total O:"<<mo<<endl;

       cout<<"el total U:"<<mu<<endl;

       cout<<"el total de espacios en blanco"<<s<<endl;

}

getch();

}




                               CODIFICACION Nº 20

//PROGRAMA METODO DE LA BURBUJA

#include <iostream.h>
#include <math.h>

#include <stdlib.h>

void main()

{

     int i,m,j,a[10];



     cout<<"METODO DE LA BURBUJA (forma
descendente)"<<endl;

     for(i=0;i<10;i++)

     {

     cout<<"CAPTURANDO"<<"["<<i<<"] : ";cin>>a[i];

     }

for(i=0;i<10;i++)

     {

           for(j=0;j<10-1;j++)

           {

                    if(a[i]>a[j])

                    {

           m=a[i];

           a[i]=a[j];

           a[j]=m;

                    }
}

     }

     cout<<"numeros ordenados";

     for(i=0;i<10;i++)

     {

            cout<<"A["<<i<<"] : "<<a[i];

     }

     getch();

}

                         CODIFICACION Nº 21

//PROGRAMA DE LA TABLA DE MULTIPLICAR DEL 5 YA
INGRESADOS

#include <iostream.h>

#include <conio.h>

void main()

{

     int a[10],b[10],c[10],i;

     i=5;

     for(int j=0;j<11;j++)

            {

                 c[10]=i*j;

                 cout<<i<<" x "<<j<<" * "<<c[10]<<endl;
}

     getch();

}

                         CODIFICACION Nº 22

//programa que ordena de mayor a menor

#include <iostream.h>

#include <conio.h>

#include <stdio.h>

void main()

{

     int vet[10],i,j,numero,aux;

     cout<<"ingrese los numeros:"<<endl;

     for(i=0;i<10;i++)

     {

          cin>>numero;

          vet[i] = numero;

     }

     cout<<"los nuemros desordenados son"<<endl;

     for(i=0;i<10;i++)

     {

          cout<<vet[i]<<endl;
}

     cout<<"los numeros ordenados son "<<endl;

     for(i=0;i<9;i++)

     for(j=i+1;j<10;j++)

     {

           if(vet[i]<vet[j])

           {

                 aux=vet[i];

                 vet[i]=vet[j];

                 vet[j]=aux;

           }

     }

     for(i=0;i<10;i++)

     cout<<vet[i]<<endl;

     getch();

     clrscr();

}

                         CODIFICACION Nº 23

//programa que ordena de menor a mayor

#include <iostream.h>

#include <conio.h>
#include <stdio.h>

void main()

{

     int vet[10],i,j,numero,aux;

     cout<<"ingrese los numeros:"<<endl;

     for(i=0;i<10;i++)

     {

          cin>>numero;

          vet[i] = numero;

     }

     cout<<"los nuemros desordenados son"<<endl;

     for(i=0;i<10;i++)

     {

          cout<<vet[i]<<endl;

     }

     cout<<"los numeros ordenados son "<<endl;

     for(i=0;i<9;i++)

     for(j=i+1;j<10;j++)

     {

          if(vet[i]>vet[j])

          {
aux=vet[i];

                 vet[i]=vet[j];

                 vet[j]=aux;

           }

      }

     for(i=0;i<10;i++)

      cout<<vet[i]<<endl;

     getch();

     clrscr();

}

                         CODIFICACION Nº 24



//PROGRAMA PARA ORDENAR LAS LETREAS

#include <iostream.h>

#include <conio.h>

#include <stdio.h>

#include <string.h>

#include <stdio.h>

void ingresarLetras(char letra[])

{

for(int i=0;i<10;i++)
{

cout<<"ingrese letras a ordenar:";

cin>>letra[i];

}

}

void ordenarLetras(char letra[])

{

int t;

for(int i=0;i<10;i++)

for(int j=10-1;j>-1;j--)

if((letra[j-1]>letra[j]))

{

t=letra[j-1];

letra[j-1]=letra[j];

letra[j]=t;

}

}

void reportar(char letra[])

{

cout<<"las letras ordenadas son:";

for(int i=0;i<10;i++)
{

cout<<letra[i]<<"        ";

}

cout<<endl;

}

void main()

{

char letra[10];

ingresarLetras(letra);

ordenarLetras(letra);

reportar(letra);

getch();

}

                         CODIFICACION Nº 25
Codificaciones c++2011

Más contenido relacionado

PDF
Codificaciones c++
PDF
Codificaciones c++2011
DOCX
Desarrollo de funciones en el sistema informatico
DOCX
Codificaciones c++
DOCX
Programacion 55
DOCX
Corridas de los ejercicios ya realizados
DOCX
Programacion
DOCX
Ejerciciosprogramacion
Codificaciones c++
Codificaciones c++2011
Desarrollo de funciones en el sistema informatico
Codificaciones c++
Programacion 55
Corridas de los ejercicios ya realizados
Programacion
Ejerciciosprogramacion

La actualidad más candente (15)

PPTX
Ejercicios resueltos de borland c++
DOCX
Ejercicios de programación.
DOCX
Codigos de programas
DOC
Franklincuñas
DOCX
DOCX
DOCX
Cedula
DOCX
Algoritmos en c++
DOCX
Unidad2 programas while , do while y for
PPTX
Presentación1
DOCX
TXT
Serie Fibonacci en C
DOCX
Prueba#3 erika quillupangui
DOCX
Ejercicios de la prueba
Ejercicios resueltos de borland c++
Ejercicios de programación.
Codigos de programas
Franklincuñas
Cedula
Algoritmos en c++
Unidad2 programas while , do while y for
Presentación1
Serie Fibonacci en C
Prueba#3 erika quillupangui
Ejercicios de la prueba
Publicidad

Destacado (20)

PDF
M ft f1_league_b
PPTX
Spring ITDF Presentation
DOCX
C vpdff
PDF
Wda t 90_2010
PPT
Biogazownie platforma józef neterowicz
PPTX
Nigarani power point
PDF
Integral definida
RTF
New Year66
PDF
Wda t 10_2010_d
PDF
Paul B. Mohr Jr. - Police Report
PPTX
Optics part i
PDF
10 vi p_r
DOCX
Tgef
PDF
Nepal van ain
PDF
Eesale Sawab Sunnat Hai
PDF
ММЭФ-2011
PDF
How to invest in mutual fund
PDF
11 lis s_u
M ft f1_league_b
Spring ITDF Presentation
C vpdff
Wda t 90_2010
Biogazownie platforma józef neterowicz
Nigarani power point
Integral definida
New Year66
Wda t 10_2010_d
Paul B. Mohr Jr. - Police Report
Optics part i
10 vi p_r
Tgef
Nepal van ain
Eesale Sawab Sunnat Hai
ММЭФ-2011
How to invest in mutual fund
11 lis s_u
Publicidad

Similar a Codificaciones c++2011 (20)

PDF
Codificaciones c++
DOCX
Programacion
DOCX
Tra 130315111309-phpapp02
DOCX
Correcion del examen del primer trimestre
PDF
Elemento 4
ODT
Franklin
ODT
franklin cuñas
DOCX
Franklin
DOCX
DOCX
Puebe de programacion
DOCX
Correccion del examen de m
DOCX
Correccion del examen de m
DOC
Correccion.
DOCX
Codificaciones c++
DOCX
Codificaciones c++
DOCX
Estructura de datos
PDF
ESTRUCTURAS ARRAYS Y DATOS C++
PDF
Programa
Codificaciones c++
Programacion
Tra 130315111309-phpapp02
Correcion del examen del primer trimestre
Elemento 4
Franklin
franklin cuñas
Franklin
Puebe de programacion
Correccion del examen de m
Correccion del examen de m
Correccion.
Codificaciones c++
Codificaciones c++
Estructura de datos
ESTRUCTURAS ARRAYS Y DATOS C++
Programa

Codificaciones c++2011

  • 2. CODIFICACION Nº 1 //PROGRMA PARA LLENAR EL VECTOR DE LOS 10 PARES Y INPARES #include < iostream.h > #include <conio.h> #include <stdio.h> void main() { int num[10] int i,int j; for(i=2;i<=20;i=i+2) cout<<"numero pares:"<<i<<endl; cin>>num[i]; gotoxy(1,12); for(j=1;j<=20;j=j+2) cout<<"numero impares:"<<j<<endl; cin>>num[j]; getch(); }
  • 3. CODIFICACION Nº 2 //PROGRMA del vector de los 10 elementos con 1,2 autor luis daquilema 6to informatica #include <stdio.h> #include <conio.h> #include <iostream.h> void main() { int n[10],i,j; cout<<"progrma del vector con elemnto 1,2:"<<endl; for(i=1;i<10;i++) { if(i%2==0) n[i]=2; else n[i]=1; } for(j=1;j<10;j++) { cout<<n[j]<<endl; }
  • 4. getch(); } CODIFICACION Nº 3 //PROGRMA del vector de los 10 elementos con 1,2,3,4,5 y 1,2,3,4,5 //autor luis daquilema 6to informatica #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { int num[2]; int n,nu,i=0; int j=0; cout<<"progrma del vector con elemnto 1,2,3,4,5:"<<endl; for(i=1;i<=5;i++) { cout<<"el vector es:"<<i<<endl; } for(j=1;j<=5;j=j+1) { cout<<"el vector es:"<<j<<endl;
  • 5. } getch(); } CODIFICACION Nº 4 //PROGRMA DEL VECTOR DE SOLO CON EL NUMERO 1 //autor luis daquilema 6to informatica #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { int num[1],i=10; cout<<"progrma del vector con elemnto 1:"<<endl; do{ cout<<"progrma del vector con elemnto 1:"<<endl; cout<<1<<endl; i++; }while(i<=num[10]); getch(); } CODIFICACION Nº 5
  • 6. //PROGRMA DEL VECTOR DE LOS NUMEROS PARES //autor luis daquilema 6to informatica #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { int par[10]; int impar[10]; cout<<"PROGRAMA DEL VECTOR DE LOS NUMEROPS PARES:"<<endl; int i; int j;int x;int num;int sumpar; sumpar=0; for(i=1;i<=10;i++) { cout<<"INGRESE NUMERO:"<<i<<endl; cin>>num; par[i]=num; } cout<<"EL CONTENIDO DEL VECTOR ES :"<<endl; for(j=1;j<=10;j++) cout<<par[j]<<endl;
  • 7. getch(); for(x=1;x<=10;x++) if(par[x]%2==0) sumpar=sumpar+par[x]; cout<<"la suma de los numeros pares es:"<<sumpar<<endl; getch(); }
  • 8. CODIFICACION Nº 6 //PROGRMA DEL VECTOR DE LOS NUMEROS PARES E IMPARES HASTA EL 20 //autor luis daquilema 6to informatica #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { float num[10]; float num1[10]; int i; int j; cout<<"porgrama de los numeros pares e impares hasta el 20:"<<i<<endl; for(i=2;i<=20;i=i+2) cout<<"los numeros pares hasta el 20:"<<i<<endl; gotoxy(1,14); for(j=1;j<=20;j=j+2) cout<<"los numeros impares hasta el 20:"<<j<<endl; cin>>num1[j]; getch();
  • 9. } CODIFICACION Nº 7 //programa para sumar los numeros impares //autor luis daquilema 6to informatica # include<iostream.h> # include<stdio.h> # include<conio.h> void main() { cout<<"programa para sumar los numeros impares"<<endl; int numero[10];int num;int i; for(i=1;i<=10;i++) { cout<<"ingrese numeros "<<i<<endl; cin>>num; numero[i]=num; } for(i=1;i<=10;i++)
  • 10. { cout<<"numeros ingresados "; cout<<numero[i]<<endl; } getch(); } CODIFICACION Nº 8 //PROGRMA DEL VECTOR DE LOS NUMEROS PARES CONTENIDOS //autor luis daquilema 6to informatica #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { int par[10]; int impar[10]; cout<<"PROGRAMA DEL VECTOR DE LOS NUMEROPS PARES:"<<endl; int i; int j;int x;int num;int sumapares; sumapares=0; for(i=1;i<=10;i++)
  • 11. { cout<<"INGRESE NUMERO:"<<i<<endl; cin>>num; par[i]=num; } cout<<"EL CONTENIDO DEL VECTOR ES :"<<endl; for(j=1;j<=10;j++) cout<<par[j]<<endl; getch(); for(x=1;x<=10;x++) if(par[x]%2==0) sumapares=sumapares+par[x]; cout<<"la suma de los numeros pares es:"<<sumapares<<endl; getch(); } CODIFICACION Nº 9 //programa la calculadora //autor Luis daquilema //6to informatica #include <iostream.h> #include <conio.h>
  • 12. #include <stdio.h> void main() { int n1,n2,op; float r; cout<<"autor Luis Daquilema :"<<endl; cout<<"programa calculadora:"<<endl; cout<<"ingrese numero:"; cin>>n1; cout<<"ingrese numero:"; cin>>n2; cout<<"ingrese opcion:"; cin>>op; if (op==1) { r=n1+n2; cout<<"la suma es:"<<r; getch(); } if (op==2) {
  • 13. r=n1-n2; cout<<"la resta es:"<<r; getch(); } if (op==3) { r=n1*n2; cout<<"la multiplicacion es:"<<r; getch(); } if (op==4) { r=n1*n2; cout<<"la division es:"<<r; getch(); } else clrscr(); getch(); clrscr(); }
  • 14. CODIFICACION Nº 10 //PROGRAMA DE DATOS DE LOS AMIGOS //lUIS DAQUILEMA //SEXTO INFORMATICA #include <iostream.h> #include<stdio.h> #include<conio.h> #define N 3 void main() { int cont=0; char op; struct agenda { char nombre[50]; int tel; int edad ; }a [10]; do {
  • 15. clrscr(); cout<<"INGRESE EL NOMBRE DEL AMIGO: "; cin>>(a[cont].nombre); cout<<endl<<"INGRESE EL NUMERO DE TELEFONO: "; cin>>(a[cont].tel) ; cout<<endl<<"INGRESE LA EDAD DEL AMIGO: "; cin>>(a[cont].edad); cout<<endl<<endl<<"¨QUIERE ALMACENAR OTRO REGISTRO SI O NO?"; cin>>op; if(op=='S' || op=='s') { cont+=1; } if(op=='N' || op=='n') { cont=cont+10; } } while(cont<10);
  • 16. clrscr(); cont-=10; for(int i=0;i<=cont;i++) { cout<<"NUMERO DE REGISTRO DE LOS CONTACTOS:"<<i+1<<endl<<endl; cout<<"EL NOMBRE DEL AMIGO ES: "<<a[i].nombre<<endl<<endl; cout<<"EL TELEFONO DEL AMIGO ES: "<<a[i].tel<<endl<<endl; cout<<"SU EDAD ES: "<<a[i].edad<<endl<<endl; getch(); } getch(); } { cout<<"amigo: "<<amigos[i].nombre<<endl<<"telefono: "<<amigos[i].telefono<<endl<<"edad: "<<amigos[i].edad<<endl; } CODIFICACION Nº 11 //PROGRAMA DE REPETICION DE SI O NO DE UN NUMERO #include <iostream.h> #include <conio.h>
  • 17. #include <stdio.h> void main () { int n,r; char res[2]; res[0]='s'; res[1]='i'; while(res[0]=='s'&&res[1]=='i') { clrscr(); cout<<"ingrese un nuero:"; cin>>n; r=n%2; res[0]='i'; while(res[0]=='s'&&res[1]=='i') clrscr(); cout<<"ingrese un numero:"; ci>>n; r=n%2; if(r==0)
  • 18. cout<<"Par"<<endl; else cout<<"Impar"<<endl; cout<<"Desea seguir si o no: "; cin>>res; } getch(); } CODIFICACION Nº 12 //PROGRAMA DE UN NUEMRO PAR O IMPAR #include<iostream.h> #include<stdio.h> #include<conio.h> void main () { int num; gotoxy(8,8); cout<<"ingrese un numero:"; cin>>num; if (num%2==0) cout<<"Es Par"<<endl;
  • 19. else cout<<"Es impar"<<endl; getch(); } CODIFICACION Nº 13 //PROGRAMA DE UN NUEMRO MAXIMO #include<iostream.h> #include<stdio.h> #include<conio.h> int maximo (int n1, int n2) { if(n1>n2) return n1; else return n2; }; void main () { int n1, n2; int max;
  • 20. cout<<"ingrese n1:"; cin>>n1; cout<<"ingrese n2:"; cin>>n2; max=maximo(n1,n2); cout<<"El nemero mayor es:"<<max; } CODIFICACION Nº 14 PROGRAMA DE DATOS DE MIS AMIGOS CON FUNCIONES #include<stdio.h> #include<iostream.h> #define n 3 struct agenda { char nombre[25]; char telefono[10]; int edad; }; struct agenda a[n];
  • 21. void main() { for(int i=0;i<n;i++) { cout<<"Ingrese nombre: "; cin>>a[i].nombre; cout<<"Ingrese edad: "; cin>>a[i].edad; cout<<"Ingresar telefono: "; cin>>a[i].telefono; } for(int j=0;j<n;j++) { cout<<"El nombre es "<<a[j].nombre; cout<<" su edad es "<<a[j].edad; cout<<" y su telefono es "<<a[j].telefono<<endl; } } CODIFICACION Nº 15
  • 22. //programa del numero mayor con funcion #include<stdio.h> #include<iostream.h> #include<conio.h> int maximo() { int n1, n2; int max; cout << "Ingrese n1: "; cin>>n1; cout << "Ingrese n2: "; cin>>n2; max=(n1,n2); if(n1>n2) max=n1; else max=n2; return max; };
  • 23. int main() { int max; max=maximo(); cout<<"El numero mayor es:"<< max; } CODIFICACION Nº 16 //programa de datos de una persona #include <stdio.h> #include <conio.h> #include <iostream.h> int telefono(int, int); int edad(int, int); int res, res3,res2; int r,r3,r2; void main() { char nom[50];
  • 24. char nom1[30]; int i;int j; int n1,n2,res2,res1,res3; cout<<"programa de datos de una persona "<<endl; int e1,e2,r2,r1,r3; int d1,d2,m1,m2,m3; for (i=1;i<=2;i++) { cout<<"ingrese nombre "<<endl; } gotoxy(20,2); cin>>nom; gotoxy(20,3); cin>>nom1; res1=telefono(n1,n2); res3=telefono(n1,n2); r1=edad(e1,e2); r3=edad(e1,e2); } int telefono(int n1,int n2)
  • 25. { cout<<"ingrese telefono: "; cin>>n1; res=n1; return(res); cout<<"ingrese telefono 2: "; cin>>n2; res2=n2; return(res3); } int edad(int e1,int e2) { cout<<"ingrese edad: "; cin>>e1; r=e1; return(r); cout<<"ingrese edad 2 "; cin>>e2; r2=e2; return(r2); getch();
  • 26. } CODIFICACION Nº 17 //PROGRAMA QUE INGRESA NUMEROS LOS VECTORES Y SUMA LOS NUMEROS PARES #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { int par[10]; int impar[10]; int i; int j;int x;int num;int sumapares; sumapares=0; for (i=1;i<=10;i++) { cout<<"ingrese un numero:"<<i<<endl; cin>>num; par[i]=num; } cout<<"El Contenido del vector es:"<<endl; for (j=1; j<=10;j++) cout<<par[j]<<endl;
  • 27. getch(); for (x=1;x<=10;x++) if (par[x]%2==0) sumapares=sumapares+par[x]; cout<<"La suma de los numeros pares es:"<<sumapares<<endl; getch(); } CODIFICACION Nº 18 //PROGRAMA QUE INGRESA ELEMENTOS EN UN VETOR #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { int num[20] int i;int j; for (i=0;i<=5;i++) { cout<<i<<endl; } cout<<"Elementos ingresados:"<<i<<endl;
  • 28. getch(); } CODIFICACION Nº 19 //PROGRAMA LA FRASE //AUTOR LUIS DAQUILEMA 6to INFORMATICA #include <iostream.h> #include <conio.h> #include <string.h> int main() { int ma=0,me=0,mi=0,mo=0,mu=0,s=0,t,ar; char frase[40]; { clrscr(); cout<<"ingrese la frase:"<<endl; cin.getline(frase,40); t=strlen(frase); cout<<"La frase tiene"<<endl; for(int c=0;c<39;c++) { if (frase[c]=='a') ma++; else if (frase[c]=='e') me++; else if(frase[c]=='i')
  • 29. mi++; else f (frase[c]=='o') mo++; else if (frase[c]=='u') mu++; else if(frase[c]==' ') s++; } cout<<"el total A:"<<ma<<endl; cout<<"el total E:"<<me<<endl; cout<<"el total I:"<<mi<<endl; cout<<"el total O:"<<mo<<endl; cout<<"el total U:"<<mu<<endl; cout<<"el total de espacios en blanco"<<s<<endl; } getch(); } CODIFICACION Nº 20 //PROGRAMA METODO DE LA BURBUJA #include <iostream.h>
  • 30. #include <math.h> #include <stdlib.h> void main() { int i,m,j,a[10]; cout<<"METODO DE LA BURBUJA (forma descendente)"<<endl; for(i=0;i<10;i++) { cout<<"CAPTURANDO"<<"["<<i<<"] : ";cin>>a[i]; } for(i=0;i<10;i++) { for(j=0;j<10-1;j++) { if(a[i]>a[j]) { m=a[i]; a[i]=a[j]; a[j]=m; }
  • 31. } } cout<<"numeros ordenados"; for(i=0;i<10;i++) { cout<<"A["<<i<<"] : "<<a[i]; } getch(); } CODIFICACION Nº 21 //PROGRAMA DE LA TABLA DE MULTIPLICAR DEL 5 YA INGRESADOS #include <iostream.h> #include <conio.h> void main() { int a[10],b[10],c[10],i; i=5; for(int j=0;j<11;j++) { c[10]=i*j; cout<<i<<" x "<<j<<" * "<<c[10]<<endl;
  • 32. } getch(); } CODIFICACION Nº 22 //programa que ordena de mayor a menor #include <iostream.h> #include <conio.h> #include <stdio.h> void main() { int vet[10],i,j,numero,aux; cout<<"ingrese los numeros:"<<endl; for(i=0;i<10;i++) { cin>>numero; vet[i] = numero; } cout<<"los nuemros desordenados son"<<endl; for(i=0;i<10;i++) { cout<<vet[i]<<endl;
  • 33. } cout<<"los numeros ordenados son "<<endl; for(i=0;i<9;i++) for(j=i+1;j<10;j++) { if(vet[i]<vet[j]) { aux=vet[i]; vet[i]=vet[j]; vet[j]=aux; } } for(i=0;i<10;i++) cout<<vet[i]<<endl; getch(); clrscr(); } CODIFICACION Nº 23 //programa que ordena de menor a mayor #include <iostream.h> #include <conio.h>
  • 34. #include <stdio.h> void main() { int vet[10],i,j,numero,aux; cout<<"ingrese los numeros:"<<endl; for(i=0;i<10;i++) { cin>>numero; vet[i] = numero; } cout<<"los nuemros desordenados son"<<endl; for(i=0;i<10;i++) { cout<<vet[i]<<endl; } cout<<"los numeros ordenados son "<<endl; for(i=0;i<9;i++) for(j=i+1;j<10;j++) { if(vet[i]>vet[j]) {
  • 35. aux=vet[i]; vet[i]=vet[j]; vet[j]=aux; } } for(i=0;i<10;i++) cout<<vet[i]<<endl; getch(); clrscr(); } CODIFICACION Nº 24 //PROGRAMA PARA ORDENAR LAS LETREAS #include <iostream.h> #include <conio.h> #include <stdio.h> #include <string.h> #include <stdio.h> void ingresarLetras(char letra[]) { for(int i=0;i<10;i++)
  • 36. { cout<<"ingrese letras a ordenar:"; cin>>letra[i]; } } void ordenarLetras(char letra[]) { int t; for(int i=0;i<10;i++) for(int j=10-1;j>-1;j--) if((letra[j-1]>letra[j])) { t=letra[j-1]; letra[j-1]=letra[j]; letra[j]=t; } } void reportar(char letra[]) { cout<<"las letras ordenadas son:"; for(int i=0;i<10;i++)
  • 37. { cout<<letra[i]<<" "; } cout<<endl; } void main() { char letra[10]; ingresarLetras(letra); ordenarLetras(letra); reportar(letra); getch(); } CODIFICACION Nº 25