Blogs Programas
Blogs Programas
2) PRESENTACION DE UN ARBOL
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
void main ()
{
int F=10, C= 40 , CO= 40,f = 26 , c = 35, ci=45;
int v=10, b= 41 , d= 41, a= 26 , u= 36, j=44;
int vi=10, bi= 42 , di= 42, ai= 26 , ui= 37, ji=43;
gotoxy(20,6);cout<<" PRESENTACION DE ARBOL NAVIDENO";
for(int i= 1; i<=15 ; i++)
{
gotoxy(C,F);cout<<"*";
gotoxy(CO,F);cout<<"*";
gotoxy(c,f);cout<<"*";
gotoxy(ci,f);cout<<"*";
f++;
F++;
CO++;
C--;
gotoxy(b,v);cout<<"*";
gotoxy(d,v);cout<<"*";
gotoxy(u,a);cout<<"*";
gotoxy(j,a);cout<<"*";
a++;
v++;
d++;
b--;
gotoxy(bi,vi);cout<<"*";
gotoxy(di,vi);cout<<"*";
gotoxy(ui,ai);cout<<"*";
gotoxy(ji,ai);cout<<"*";
ai++;
vi++;
di++;
bi--;
}
for(int CC= 25; CC<= 55; CC=CC+2)
{
gotoxy(CC,F);cout<<"*" ;
}
for(int Cl= 25; Cl<= 55; Cl=Cl+2)
{
gotoxy(Cl,f);cout<<"*" ;
}
getch();
}
3. CAJERO AUTOMTICO
4. #include <stdio.h>
5. #include <conio.h>
6. #include <iostream.h>
7. #include <math.h>
8. void main ()
9. {
10.int I= 0, C= 0 ;
11.float res= 0, de = 0, sun =0, re=0 ;
12.do
13.{
14.gotoxy(9,4);cout<<" 1 SALDO INICIAL";
15.gotoxy(9,5);cout<<" 2 DEPOSITO ";
16.gotoxy(9,6);cout<<" 3 RETIRO ";
17.gotoxy(9,7);cout<<" 4 CONSULTA DE SALDO ";
18.gotoxy(9,8);cout<<" 5 SALIR ";
19.gotoxy(9,9);cout<<"INGRESE UNA DE LAS OPCIONES DEL SIGUIENTE MENU ";
20.gotoxy(9,10);cin>>I;
21.if(I==1)
22.{
23.gotoxy(9,13);cout<<"DIJITE EL SALDO INICIAL : ";cin>> C;
24.gotoxy(9,13);cout<<" ";
25.}
26.if (I==2)
27.{
28.gotoxy(9,13);cout<<"CUANTO DESEA DEPOSITAR : " ;cin>> de;
29.gotoxy(9,13);cout<<" ";
30.sun = de + sun;
31.}
32.if(I==3)
33.{
34.gotoxy(9,13);cout<<"DIJITE LA CANTIDA QUE DESEA RETIRAR : ";cin>>re;
35.gotoxy(9,13);cout<<" ";
36.if(re < sun)
37.{res = sun - re;}
38.else
39.{ gotoxy(9,13);cout<<"EL SALDO ES INSUFICIENTE ";
40.gotoxy(9,13);cout<<" ";}
41.}
42.if(I== 4)
43.{gotoxy(9,13);cout<<"TOTAL DE SALDO ES: " << C + de - re;}
44.}
45.while(I!=5);
46.gotoxy(9,13);cout<<" ";
47.gotoxy(9,13);cout<<"SE CERRARA EL PROGRAMA DE UN ENTER...............";
48.getch();}
7. PRESENTACION DE CUADRADO
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
void main ()
{
int F=10, C= 30 , CO= 50 , FI= 10;
gotoxy(19,3);cout<<"INSTITUTO TECNOLOGICO SUPERIOR HUAQUILLAS";
gotoxy(20,6);cout<<"PROGRAMA PRESENTACION DE CUADRADO";
for(int i= 1; i<=9 ; i++)
{
gotoxy(C,F);cout<<"*";
gotoxy(CO,F);cout<<"*";
F++;
}
8. PRESENTACION DE UN TRIANGULO.
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
void main ()
{int F=10, C= 13 , CO= 63 , FI= 10;
gotoxy(20,6);cout<<PROGRAMA PRESENTACION DE RECTANGULO;
for(int i= 1; i<=9 ; i++)
{gotoxy(C,F);cout<<"*";
gotoxy(CO,F);cout<<"*";
F++;}
for(int CC= 13; CC<= 63; CC=CC+2)
{gotoxy(CC,F);cout<<"*";
gotoxy(CC,FI);cout<<"*";}
getch();}
else
{ if(n4 > n5)
{ cout<<"el mayor es : " << n4;}
else
{cout<<"el mayor es : " << n5;}
}
}else
{
if( n3 > n4 )
{
if (n3 > n5)
{cout<<"el mayor es : " << n3;}
else
{cout<<" el mayor es: " << n5;}
}
else
{
if(n4 > n5)
{ cout<<" el mayor es:" << n4;}
else
{cout<<"el mayor es:" << n5;
}
}
}
}
else
{
if(n2 > n3)
{
if(n2 > n4)
{
{
gotoxy(3,10);cout<<" INGRESE UN NUMERO : " ;
gotoxy(6,12);cout<<" " ;
gotoxy(6,12);cin>> num;
if(num % 5 == 0)
{gotoxy(13,15);cout<<"El numero : " << num << " es multiplo de cinco";}
else
{gotoxy(13,18);cout<<"El numero : " << num << " No es multiplo de cinco ";}
if(num % 4 == 0)
{gotoxy(13,16);cout<<"El numero : " << num << " es multiplo de cuatro";}
else
{gotoxy(13,19);cout<<"El numero : " << num << " No es multiplo de cuatro ";}
if(num % 6 == 0){gotoxy(13,17);cout<<"El numero : " << num << " es multiplo de seis";}
else{gotoxy(13,20);cout<<"El numero : " << num << " No es multiplo de seis ";} }
getch();}
13. INGRESE 5
NUMEROS
DETERMINAR
CUAL ES PRIMO
Y CUAL NO LO
ES.
#include
<stdio.h>
#include
<conio.h>
#include
<iostream.h>
#include
<math.h>
void main ()
{
int num ;
gotoxy(19,3);cout<<"INSTITUTO TECNOLOGICO SUPERIOR HUAQUILLAS";
gotoxy(27,4);cout<<" PROGRAMACION COMERCIAL";
gotoxy(18,5);cout<<" NOMBRE: HILDA RAMIREZ MORENO";
15. INGRESO DE NMERO MIENTRAS SEA DIFERENTE QUE CERO Y PRESENTE EL MAYOR.
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
#include <math.h>
void main ()
{int h = 0, ma = 0 ;
do
{cout<<"INGRESE UN NUMERO : ";
cin>> h;
if( h > ma)
{ma = h;} }
while(h != 0);
clrscr();
cout<<"El numero mayor de los numeros ingresados es : " << ma;
getch();
#include <iostream.h>
void main()
{
int n1 = 0, n2= 0 ;
gotoxy(12,14);cout<<"****************************";
gotoxy(12,16);cout<<"****************************";
gotoxy(12,1);cout<<"************************************************************";
gotoxy(12,5);cout<<"************************************************************";
gotoxy(12,2);cout<<"*"; gotoxy(71,2);cout<<"*";
gotoxy(12,3);cout<<"*"; gotoxy(71,3);cout<<"*";
gotoxy(12,4);cout<<"*"; gotoxy(71,4);cout<<"*";
gotoxy(14,3);cout<<"DETERMINE CUAL DE LOS DOS NUMEROS INGRESADOS ES EL MAYOR ";
gotoxy(7,10);cout<<"\1 Ingrese primer numero : "; cin>> n1;
gotoxy(7,11);cout<<"\3 Ingrese segundo numero: "; cin>> n2;
if(n1 > n2 )
{gotoxy(13,15);cout<<"El numero mayor es: \5 " << n1; }
else
{gotoxy(13,15);cout<<"El numero mayor es: \5 " << n2;}
_getch();
}
}
else
{
cout<<"\nNO DISPONE DE ESA CANTIDAD DE DINERO ";
}
} break;
case 2:
cout<<"\CONSULTA DE SALDO ";
cout<<"\n\nSU SALDO DISPONIBLE ES ---> "<<saldo_inicial;
break;
case 3:
ganancia=nuevo_saldo*0.35;
cout<<"\nGANANCIA POR TRANSACCIONES "<<ganancia;
break;
case 4:
cout<<"\nGRACIAS POR UTILIZAR NUESTROS SERVICIOS ";
cout<<"\n\nES UN GUSTO SERVIRLE ";
break;
default: cout<<"\nOPCION INCORRECTA " ;
} getch();
system ("cls");
}while(saldo_inicial!=0);
getch();
}
{ r=r*n; }
v1[i]=r;
gotoxy(51,f);cout<<v1[i];
r=1;f++;ii++;
}gotoxy(5,14); cout<<" Ingrese 3 numeros mas:";
gotoxy(46,14); cout<<"Elevado al cubo:";
for(int i=0;i<=2; i++)
{ gotoxy(13,ff); cin>>n;
v2[i]= n*n*n;
gotoxy(51,ff);cout<<v2[i];
ff++;
}
clrscr();
gotoxy(17,10);cout<<"TABLA DE RESULTADOS.";
gotoxy(10,12);cout<<"VECTOR#1";gotoxy(10,13); cout<<"Factorial";
gotoxy(32,12);cout<<"VECTOR#2";gotoxy(29,13); cout<<"Elevado al cubo";
gotoxy(53,12);cout<<"VECTOR#3";gotoxy(50,13); cout<<"Fac + cub - 2 =";
for(int i=0;i<=2; i++)
{v3[i]= v1[i]+v2[i]-2;
gotoxy(13,fff);cout<<v1[i];
gotoxy(36,fff);cout<<v2[i];
gotoxy(56,fff);cout<<v3[i];
fff++;
}getch ();
}
{suma=suma + v[i];}
pro= suma/ 5;
return pro;
}
//ingrese 10 elementos en un vector y presentar el mayor ,menor y el promedio de la mismas.
float main()
{float v[5];int f= 5;
cout<<"\n\n INGRESE ELEMENTOS AL VECTOR ";
for (int i=0;i<5;i++)
{gotoxy(5,f);cin>>v[i];f++;};
cout<<"\n\n La mayor es : "<<fun_mayor(v);
cout<<"\n\n La menor es : "<<fun_menor(v);
cout<<"\n\n El promedio es :"<<fun_prome(v);
getch();
}
}
int main()
{ int ed[5],f=4;
if(v3[x]> may3)
{may3 = v3[x];}
} return may3;
}
int main()
{ int v1[4],v2[4],v3[4],f=15;
gotoxy(5,8); cout<<" INGRESE 5 ELEMENTOS EN UN VECTOR Y PRESENTAR EL NUMERO MAYOR";
gotoxy(10,12); cout<<"V1";
gotoxy(20,12); cout<<"V2";
gotoxy(30,12); cout<<"V3";
for( int x=0; x<4; x++)
{gotoxy(10,f);cin>> v1[x];
f++;
} f=15;
for( int x=0; x<4; x++)
{gotoxy(20,f);cin>> v2[x];
f++;} f=15;
for( int x=0; x<4; x++)
{gotoxy(30,f);cin>> v3[x];f++;}
gotoxy(40,15);cout<<"MAYOR V1 ES:"<<funcion_may(v1);
gotoxy(40,16);cout<<"MAYOR V2 ES:"<<funcion_may2(v2);
gotoxy(40,17);cout<<"MAYOR V3 ES:"<<funcion_may3(v3);
getch();
}
}
return cin;
}
int multio(int num[])
{
int cua=0;
for(int P = 1; P<6 ; P++)
{
if(num[P] % 4 == 0)
{
cua=cua+1;
}
}
return cua;
}
int multii(int num[])
{
int sei=0;
for(int J= 1;J<6; J++)
{
if(num[J] % 6 == 0)
{
sei = sei +1;
}
}
return sei;
}
int main()
{
int num[5],f=12 ;
gotoxy(10,6);cout<<"PROGRAMA INGRESE 5 NUMEROS Y ENCONTRAR MULTIPLOS DE 5 , 4, 6";
for(int i = 1 ; i<6; i++)
{
gotoxy(3,10);cout<<" INGRESE UN NUMERO : " ;
gotoxy(6,f);cin>>num[i];
f++;
}
gotoxy(20,16);cout<<"TOTAL MULTIPLO DE CINCO :"<<multip(num);
gotoxy(20,17);cout<<"TOTAL MULTIPLO DE SEIS :"<<multii(num);
gotoxy(20,18);cout<<"TOTLA MULTIPLO DE CUATRO :"<<multio(num);
getch();
}
}
float fun_divi(float a , float b)// se guardara el valor de x como a= x
{
float c;
c= a/b;
return c;
}
void menu()
{
cout<<"\n\t OPERACIONES MATEMATICAS C++\n\n";
cout<<" \7 \1. INGRESO ELEMENTO "<<endl;
cout<<" \7 \2. SUMA "<<endl;
cout<<" \7 \3. RESTA "<<endl;
cout<<" \7 \4. MULTIPLICACION "<<endl;
cout<<" \7 \5. DIVICION "<<endl;
cout<<" \7 \6. SALIR "<<endl;
cout<<"\n INGRESE OPCION: ";
}
int main()
{
int op;
float x ,y ;
system("color F0");
do
{
menu();
cin>> op;
switch(op)
{
case 1:
system ("cls");
cout<<"\n\t INGRESE UN NUMERO: "; cin>> x ;
cout<<"\n\t INGRESE UN NUMERO: "; cin>> y ;
break;
case 2:
system ("cls");
cout<<"\n\n LA SUMA DE : "<< x <<" + " << y << " = " << fun_suma(x ,y);
break;
case 3:
system ("cls");
cout<<"\n\n LA RESTA DE : "<< x <<" - " << y << " = " << fun_res(x ,y);
break;
case 4:
system ("cls");
cout<<"\n\n LA MULTIPLICACION DE : "<< x <<" * " << y << " = " << fun_mut(x ,y);
break;
case 5:
system ("cls");
cout<<"\n\n LA DIVICION DE : " << x <<" / " << y << " = " << fun_divi(x ,y);
break;
}
cout<<endl<<endl;
system("pause"); system("cls");
}while(op!=6);
return 0;
}
gotoxy(20,15);cout<<"MAYOR ES:"<<funcion_may(v1);
getch();
}
float a,b;
cin>>a;
b=pow(a,3); // pow permite para sacar la potencias
cout<<"\n\n\tEL CUBO DEL NUMERO INGRESADO ES : "<<b;
}
int main()
{
system("color f0");
gotoxy(20,3);cout<<" INSTITUTO TECNOLOGICO SUPERIOR HUAQUILLAS ";
gotoxy(15,6);cout<<" INGRESAR UN NUMERO Y PRESENTAR SU CUBO ";
gotoxy(15,9); cout<<" INGRESE UN NUMERO: ";
funcion_cubo();
getch();
}
void main()
{cout<<"\n\n INGRESE ELEMENTOS AL VECTOR ";
fun_op();
getch();
}