sábado, 24 de noviembre de 2012

PROGRAMA QUE MUESTRE LAS DIFERENTES SERIES

ESTE ES UN PROGRAMA QUE PERMITE QUE EL USUARIO ESCOJA LA SERIE QUE DESEA VER, ESTA REALIZADO EN LENGUAJE  C++.

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<ctype.h>
void main (void)
{
int op=1,a,b,x,c,i;
a=1;
b=1;
x=0;
c=-1;
while(op!=4)  //para permitir al usuario escoger una opcion
{
textcolor(1);       //color de la letra
textbackground(3);  //color del fondo
clrscr();           //para limpiar pantalla
gotoxy(20,9);cout<<"MI PRIMER PROGRAMA CON MENU";
gotoxy(17,10);cout<<"PROGRAMA DE LAS DIFERENTES SERIES ";
gotoxy(19,13);cout<<"1 - Serie de fibonacci";
gotoxy(19,14);cout<<"2 - serie de lucas";
gotoxy(19,15);cout<<"3 - serie de arlenys";
gotoxy(19,16);cout<<"4 - Salir";
do{
gotoxy(20,19);cout<<"Seleccione una de las alternativas";
gotoxy(58,19);cin>>op;
gotoxy(30,22);cout<<"Alternativa No Valida";
}while((op<1)||(op>4));
clrscr();
switch (op){
       case 1:
    textcolor(1);
      textbackground(6);
    clrscr();
 gotoxy(25,3);cout<<" SERIE DE FIBONACCI   ";

      for(i=1;i<=18;i++)
      i++;
      {
      if(i>0)
      {
     if(i==1)cout<<"1"<<endl;
    else
    {
    cout<<endl<<a<<","<<b<<",";
    while(c<i-2)
    {
    c++;
    x=a+b;
    cout<<x<<",";
    a=b;
    b=x;
    }
    getch();
    }
    break;

      case 2:
int a,b,z,c,i;
a=1;
b=3;
z=0;
c=-1;
textcolor(5);
textbackground(16);
clrscr();
gotoxy(15,3);printf("PROGRAMA QUE MUESTRE LA SERIE DE LUCAS ");
for(i=1;i<=18;i++)
i++;
{
if(i>0)
{
if(i==1)cout<<"1"<<endl;
else
{
cout<<endl<<a<<","<<b<<",";
while(c<i-2)
{
c++;
z=a+b;
cout<<z<<",";
a=b;
b=z;
}
getch();
}
}
}
}
      break;

     case 3:
    textcolor(6);
textbackground(16);
clrscr();
    gotoxy(19,3);cout<<" SERIE DE ARLENYS ";
    int c,f=5,x=2,i=1;
    for(int a=1;a<=80;a++)
    {
    gotoxy(a,1);
       printf("*");
       gotoxy(a,24);
       printf("*");
       }
       c=6;
      while(i<=5)
      {
      gotoxy(c,6);cout<<x<<",  "<<f<<",  ";
      gotoxy(49,6);cout<<"  ";
      x=x+5;
      f=f+5;
      c=c+9;
      i++;
     for(int y=1;y<=24;y++)
     {
     gotoxy(1,y);
     printf("*");
     gotoxy(80,y);
     printf("*");
     }
     }
     getch();
     }
     break;

     case 4:
    gotoxy(20,20);cout<<"Pulse Cualquier Tecla para Salir";
    getch();
    }
    break;
    }
    getch();
    }


PROGRAMA QUE SUME LA SERIE DE 10 EN 10 DEL 100 HASTA EL O

 ESTE ES UN PROGRAMA QUE SUMA LA SERIE 100+90+80+70+60+50.....HASTA LLEGAR A 0.
 ESTA REALIZADO EN LENGUAJE C++.

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main (void)
{
int s,j=5,x=0;
textcolor(1);
textbackground(8);
clrscr();
gotoxy(16,2);printf(" SUMA DE LA SERIE DE 100 HASTA 0");
gotoxy(22,4);cout<<" sumar la siguiente serie ";
for(s=100;s>=0;s=s-10)
{
j=j+5;
gotoxy(j,8);cout<<s<<" + ";gotoxy(62,8);cout<<"   ";
x=x+s;
}
gotoxy(8,10);cout<<" la suma de la serie es : "<<x;
getch();
}

PROGRAMA PARA CALCULAR EL VALOR ABSOLUTO DE UN NUMERO

PROGRAMA QUE EL USUARIO INGRESE UN NUMERO E IMPRIMA EL NUMERO Y EL VALOR   ABSOLUTO DEL MISMO. ESTA REALIZADO EN LENGUAJE C++.

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
#include<stdlib.h>
void main (void)
{
textcolor(1);
textbackground(6);
clrscr();
float num;
gotoxy(30,2);printf("EL VALOR ABSOLUTO DE UN NUMERO");
gotoxy(10,4);cout<<"ingrese un numero";
gotoxy(10,6);cin>>num;
gotoxy(10,8);cout<<"el valor absoluto del numero es:"<< abs(num);
getch();
}

PROGRAMA PARA CALCULAR EL PRODUCTO DE LOS NUMEROS ENTEROS DEL 11 AL 20

 PROGRAMA  PARA CALCULAR EL PRODUCTO DE LOS NUMEROS ENTEROS DEL 11 AL 20.
 ESTA REALIZADO  EN LENGUAJE C++.

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main (void)
{
textcolor(5);
textbackground(7);
clrscr();
double k=11,mul=10;
int q,b,j=9;
for(int x=1;x<=80;x++)
{
gotoxy(x,1);
printf("*");
gotoxy(x,24);
printf("*");
}
for(int y=1;y<=24;y++)
{
gotoxy(1,y);
printf("*");
gotoxy(80,y);
printf("*");
}
gotoxy(18,3);printf(" PRODUCTO DE LOS NUMEROS ENTEROS DEL 11 AL 20" );
for (q=9;q<=61;q++)
{
gotoxy(q,7);cout<<"_";
gotoxy(q,9);cout<<"-";
}
gotoxy(5,5);cout<<" Al multiplicar la siguiente secuencia de numeros";

while(k<=20){
gotoxy(j,8);cout<<k<<" * ";
j=j+5;
mul=mul*k;
k++;
}
gotoxy(8,10);cout<<" el producto de esta serie  es: "<<mul;

getch ();
}

PROGRAMA PARA CALCULAR EL PRODUCTO DE LOS NUMEROS ENTEROS DEL 1 AL 10

 PROGRAMA  PARA CALCULAR EL PRODUCTO DE LOS NUMEROS ENTEROS DEL 1 AL 10.
 ESTA REALIZADO  EN LENGUAJE C++.

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main (void)
{
textcolor(13);
textbackground(0);
clrscr();
float n,k=1,mul=1,j=9;
int q,b;
for(int x=1;x<=80;x++)
{
gotoxy(x,1);
printf("*");
gotoxy(x,24);
printf("*");
}
for(int y=1;y<=24;y++)
{
gotoxy(1,y);
printf("*");
gotoxy(80,y);
printf("*");
}
gotoxy(18,3);printf(" PRODUCTO DE LOS NUMEROS ENTEROS DEL 1 AL 10" );
for (q=9;q<=61;q++)
{
gotoxy(q,7);cout<<"_";
gotoxy(q,9);cout<<"-";
}
gotoxy(5,5);cout<<" Al multiplicar la siguiente secuencia de numeros";

while(k<=10){
gotoxy(j,8);cout<<k<<" * ";
j=j+5;
mul=mul*k;
k++;
}
gotoxy(8,10);cout<<" el producto de esta serie es: "<<mul;

getch ();
}

PROGRAMA QUE CONVIERTE DE EUROS A PESETAS


       DISEÑAR UN ALGORITMO QUE LEA UN VALOR EN EUROS Y LO CONVIERTA A PESETAS (1 EURO =166,386 PTAS).ESTA REALIZADO  EN LENGUAJE C++.

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main (void)
{
textcolor(1);
textbackground(8);
clrscr();
float euros,ptas;
gotoxy(30,4);cout<<"CONVERTIR DE EUROS A PESETAS";
gotoxy(10,6);cout<<"ingrese los euros a cambiar ";
cin>>euros;
ptas=euros*166,386;
gotoxy(10,8);cout<<"su valor en pesetas es: "<<ptas;
getch();
}

PROGRAMA QUE MUESTRA 20 NUMEROS PARES Y 20 IMPARES

REALIZAR UN PROGRAMA QUE GENERE LOS 20 PRIMEROS NUMEROS PARES Y LOS 20 PRIMEROS NUMEROS IMPARES. ESTA REALIZADO  EN LENGUAJE C++.

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

void main (void)
{
int i=0, k=0;
textcolor(5);
textbackground(8);
clrscr();
gotoxy(15,2);printf("PROGRAMA QUE MUESTRA LOS NUMEROS PARES E IMPARES");
for(i=1,k=2;i<=20,k<=20;i+=2,k+=2)
{
gotoxy(15,6);cout<<"numeros impares";
gotoxy(i+i,10);cout<<i;
gotoxy(15,14);cout<<"numeros pares";
gotoxy(k+k,18);cout<<k;
}
getch();
}