SlideShare una empresa de Scribd logo
1 de 38
Descargar para leer sin conexión
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

La actualidad más candente (15)

Ejercicios resueltos de borland c++
Ejercicios resueltos de borland c++Ejercicios resueltos de borland c++
Ejercicios resueltos de borland c++
 
Problema c++
Problema c++Problema c++
Problema c++
 
Ejercicios de programación.
Ejercicios de programación.Ejercicios de programación.
Ejercicios de programación.
 
Codigos de programas
Codigos de programasCodigos de programas
Codigos de programas
 
Franklincuñas
Franklincuñas  Franklincuñas
Franklincuñas
 
Programacion
ProgramacionProgramacion
Programacion
 
Informe tecnico
Informe tecnicoInforme tecnico
Informe tecnico
 
Cedula
CedulaCedula
Cedula
 
Algoritmos en c++
Algoritmos en c++Algoritmos en c++
Algoritmos en c++
 
Unidad2 programas while , do while y for
Unidad2 programas while , do while  y forUnidad2 programas while , do while  y for
Unidad2 programas while , do while y for
 
Presentación1
Presentación1Presentación1
Presentación1
 
Ejer
EjerEjer
Ejer
 
Serie Fibonacci en C
Serie Fibonacci en CSerie Fibonacci en C
Serie Fibonacci en C
 
Prueba#3 erika quillupangui
Prueba#3 erika quillupanguiPrueba#3 erika quillupangui
Prueba#3 erika quillupangui
 
Ejercicios de la prueba
Ejercicios de la pruebaEjercicios de la prueba
Ejercicios de la prueba
 

Destacado (20)

M ft f1_league_b
M ft f1_league_bM ft f1_league_b
M ft f1_league_b
 
Spring ITDF Presentation
Spring ITDF PresentationSpring ITDF Presentation
Spring ITDF Presentation
 
C vpdff
C vpdffC vpdff
C vpdff
 
Wda t 90_2010
Wda t 90_2010Wda t 90_2010
Wda t 90_2010
 
Biogazownie platforma józef neterowicz
Biogazownie platforma józef neterowiczBiogazownie platforma józef neterowicz
Biogazownie platforma józef neterowicz
 
Nigarani power point
Nigarani power pointNigarani power point
Nigarani power point
 
Integral definida
Integral definidaIntegral definida
Integral definida
 
What is hiv aids
What is hiv aidsWhat is hiv aids
What is hiv aids
 
New Year66
New Year66New Year66
New Year66
 
Wda t 10_2010_d
Wda t 10_2010_dWda t 10_2010_d
Wda t 10_2010_d
 
Paul B. Mohr Jr. - Police Report
Paul B. Mohr Jr. - Police ReportPaul B. Mohr Jr. - Police Report
Paul B. Mohr Jr. - Police Report
 
Optics part i
Optics   part iOptics   part i
Optics part i
 
10 vi p_r
10 vi p_r10 vi p_r
10 vi p_r
 
Tgef
TgefTgef
Tgef
 
Nepal van ain
Nepal van ainNepal van ain
Nepal van ain
 
Eesale Sawab Sunnat Hai
Eesale Sawab Sunnat HaiEesale Sawab Sunnat Hai
Eesale Sawab Sunnat Hai
 
ММЭФ-2011
ММЭФ-2011ММЭФ-2011
ММЭФ-2011
 
How to invest in mutual fund
How to invest in mutual fundHow to invest in mutual fund
How to invest in mutual fund
 
11 lis s_u
11 lis s_u11 lis s_u
11 lis s_u
 
my idea
my ideamy idea
my idea
 

Similar a Codificaciones c++2011

Similar a Codificaciones c++2011 (20)

Codificaciones c++
Codificaciones c++Codificaciones c++
Codificaciones c++
 
Codificaciones c++
Codificaciones c++Codificaciones c++
Codificaciones c++
 
Codificaciones c++
Codificaciones c++Codificaciones c++
Codificaciones c++
 
Programas
ProgramasProgramas
Programas
 
G++
G++G++
G++
 
Jorge informe tecnico
Jorge informe tecnicoJorge informe tecnico
Jorge informe tecnico
 
Informe 2 da unidad lp
Informe 2 da unidad lpInforme 2 da unidad lp
Informe 2 da unidad lp
 
Blog
BlogBlog
Blog
 
Blog
BlogBlog
Blog
 
Programacion
ProgramacionProgramacion
Programacion
 
Do while
Do whileDo while
Do while
 
Problemas+resueltos+de+c$2 b$2b
Problemas+resueltos+de+c$2 b$2bProblemas+resueltos+de+c$2 b$2b
Problemas+resueltos+de+c$2 b$2b
 
Problemas resueltos de c++
Problemas  resueltos de c++Problemas  resueltos de c++
Problemas resueltos de c++
 
Tra
TraTra
Tra
 
Funcione
FuncioneFuncione
Funcione
 
Tra 130315111309-phpapp02
Tra 130315111309-phpapp02Tra 130315111309-phpapp02
Tra 130315111309-phpapp02
 
Do while ss
Do while ssDo while ss
Do while ss
 
Correccion de la prueba mfsi
Correccion de la prueba mfsiCorreccion de la prueba mfsi
Correccion de la prueba mfsi
 
Ejercicio 1
Ejercicio 1Ejercicio 1
Ejercicio 1
 
Funcione
FuncioneFuncione
Funcione
 

Codificaciones c++2011

  • 1.
  • 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