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)
{
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)
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>