PROGRAMA MAYOR DE TRES NUMEROS
#include<stdio.h>
#include<conio.h>
main()
{
int a,b,c;
printf("programa que permite obtener el mayor de 2 numeros\n"); printf("introduzca el primer numero\n"); scanf("%d",&a);printf("introduzca el segundo numero\n");
scanf("%d",&b);
printf("introduzca el tercer numero\n");
scanf("%d",&c);
if(a>=b &&a>=c)
{
printf("el mayor es %d",a);
}
else
{
if(b>=a && b>=c)
{
printf("el mayor es %d",b);
}
else
{
printf("el mayor es %d",c);
}
}
getch();
}
PROGRAMA MAYOR DE 4 NUMEROS
#include<conio.h>
main()
{
int n,cont,b,max;
b=0;
printf("\n Programa que permite obtener el mayor de cuatro numeros");
for(cont=0;cont<4;cont++)
{
printf("\n Ingrese numero:");
scanf("%d",&n);
if(b==0||n>max)
{
max=n;
b=1;
}
}
printf("\nEl mayor es: %d",max);
getch();
}
PROGRAMA QUE PRESENTA LA TABLA DE MULTIPLICAR DEL 7
#include<conio.h>
main()
{
int c=0;
for(c=1;c<=12;c++)
{
printf("7 x %d = %d\n",c,7*c);
}
getch();
}
PROGRAMA QUE PRESENTA LA TABLA DEL 1 AL 10
#include<conio.h>
main()
{
int x=0,y=0
,resultado;
printf("TABLAS DE MULTIPLICAR");
while(x<=10)
{
while(y<=10)
{
resultado= x*y;
printf("\n%d",&x);
printf("%d",&y);
printf("=%d",&resultado);
y=y+1;
x=x+1;
getch();
}
}
getch();
}
PROGRAMA QUE PERMITE PRESENTAR LOS 10 PRIMEROS NUMEROS PARES
# include <conio.h>
main()
{
int c=0;
printf("PROGRAMA QUE PERMITE GENERAR 10 PRIMEROS NUMEROS PARES \n");
while(c<=18)
{
c=c+2;
printf("\n%d",c);
}
getch();
}
PROGRAMA QUE PERMITE PRESENTAR LOS 10 PRIMEROS NUMEROS IMPARES
# include <stdio.h>
# include <conio.h>
main()
{
int c=1;
printf("PROGRAMA QUE PERMITE GENERAR 10 PRIMEROS NUMEROS IMPARES \n");
while(c<=19)
while(c<=19)
{
printf("\n%d",c);
c=c+2;
}
getch();
}
# include <stdio.h>
PROGRAMA QUE PERMITE PRESENTAR LA SUMA DE LOS 10 PRIMEROS NUMEROS PARES.
# include <stdio.h>
# include <conio.h>
main()
{
int c=0,acum=0;
printf("PROGRAMA QUE PERMITE PRESENTAR LA SUMA DE LOS 10 PRIMEROS
NUMEROS PARES \n");
while(c<=18)
{
c=c+2;
printf("\n%d",c);
acum=acum+c;
}
printf("\n\nLA SUMA es %d\n",acum);
getch();
}
# include <stdio.h>
PROGRAMA QUE PERMITE GENERAR LA SUMA DE LOS 10 PRIMEROS NUMEROS IMPARES.
# include <stdio.h>
# include <conio.h>
main()
{
int c=1,acum=0;
printf("PROGRAMA QUE PERMITE PRESENTAR LA SUMA DE LOS 10 PRIMEROS
NUMEROS IMPARES \n");
while(c<=19)
{
printf("\n%d",c);
c=c+2;
acum=acum+c;
}
printf("\n\nLA SUMA es %d\n",acum);
getch();
}
#include<conio.h>
#include<stdio.h>
#include<windows.h>
#include<stdlib.h>
void gotoxy(int x,int y)
{
HANDLE hcon;
hcon = GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwPos;
dwPos.X = x;
dwPos.Y= y;
SetConsoleCursorPosition(hcon,dwPos);
}
main()
{
system("cls");
int clave;
int op,op1,op2,op3,saldo,DEPOSITOS,RETIROS,CONSULTAS,SALIR,ingreso,retirar,trans;
saldo=500;
gotoxy(16,2);printf ("|************ **** **+*+");
gotoxy(16,3);printf ("| ************ *** +*+*+*+");
gotoxy(16,4);printf ("| ************ *** *+*+*+*");
gotoxy(16,5);printf ("| ************* **** *+* *+*+");
gotoxy(16,6);printf ("| ************ ** ** *+* *+*+");
gotoxy(16,7);printf ("| *********** ** *** *+* *+*+");
gotoxy(16,8);printf ("| ************ ** *** *+* *+*+");
gotoxy(16,9);printf ("| ************* ** *** *+* *+*+");
gotoxy(16,10);printf("| ************** ** *** *+* *+*+");
gotoxy(16,11);printf("| ************* ** *** *+* *+*+");
gotoxy(16,12);printf("| ************ ** **** +* *+*+");
gotoxy(16,13);printf("| *********** ** ***** *+*+");
gotoxy(16,14);printf("| *********** ** *+*+");
gotoxy(16,15);printf("|************ ** *+*+");
gotoxy(33,20);printf(" !~Bienvenido~!");
gotoxy(3,22);printf("Por favor digite su clave de acceso[ ]");
gotoxy(40,22);scanf("%i",&clave);
while(clave!=1105)
{
system("cls");
gotoxy(3,10);printf("Clave incorrecta");
gotoxy(2,15);printf("Vuelva a digitar la clave de acceso[ ]");
gotoxy(39,15);scanf("%i",&clave);
getch();
}
do
{
system("cls");
gotoxy(25,15);printf("+-------------------------+");
gotoxy(25,17);printf("| CAJERO AUTOMATICO |");
gotoxy(25,19);printf("| DEPOSITOS...........1 |");
gotoxy(25,21);printf("| RETIROS.............2 |");
gotoxy(25,23);printf("| CONSULTAS...........3 |");
gotoxy(25,25);printf("| SALIR...............4 |");
gotoxy(25,27);printf("| ESCOJA UNA OPCION.[ ]|");
gotoxy(25,29);printf("+-------------------------+");
gotoxy(48,27);scanf("%d",&op);
switch(op)
{
case 1:
system("cls");
gotoxy(32,2);printf("+**~DEPOSITOS~**+");
gotoxy(16,4);printf("~ Introduzca la cantidad que desea depositar:[ ]");
gotoxy(63,4);scanf("%i",&ingreso);
saldo=saldo+ingreso;
gotoxy(24,6);printf ("****El saldo de su cuenta es %i****",saldo);
gotoxy(25,13);printf("Desea otra trans []s/n");
getch();
break;
case 2:
system("cls");
gotoxy(32,2);printf("+**~RETIROS~**+");
gotoxy(16,4);printf ("Introduzca la cantidad a retirar:[ ] ");
gotoxy(50,4);scanf ("%i",&retirar);
if (retirar>saldo)
{
gotoxy(23,4);printf ("No dispone de tanto dinero en su cuenta");
gotoxy(23,5);printf ("El saldo disponible es: %i dolares",saldo);
}
else
{
saldo=saldo-retirar;
gotoxy(24,6);printf ("Ha retirado %i dolares",retirar);
gotoxy(24,7);printf ("Su saldo final es: %i dolares",saldo);
}
gotoxy(25,13);printf("Desea otra trans s/n[]");
getch();
break;
case 3:
system("cls");
gotoxy(32,2);printf("+**~CONSULTAS~**+");
gotoxy(23,5);printf ("El saldo de su cuenta es: %i dolares",saldo);
gotoxy(25,13);printf("Desea otra trans [s/n]");
getch();
break;
case 4:
system("cls");
gotoxy(23,7);printf( "~~****** ~** **~ ");
gotoxy(23,8);printf( " ~* ** +*** *** ");
gotoxy(23,9);printf( " * +** +** * ** ");
gotoxy(23,10);printf(" ~* ** +** ** ");
gotoxy(23,11);printf("~~****** $ ~** **~ " );
gotoxy(15,14);printf("GRACIAS POR UTILIZAR NUESTROS SERVICIOS ");
gotoxy(23,15);printf("FUE UN PLACER ATENDERLE ");
break;
default:
system("cls");
printf("Error....vuelva a digitar la opción correcta");
getch();
}
}
while(op!=4);
getch();
}
PROGRAMA CAJERO AUTOMATICO
#include<conio.h>
#include<stdio.h>
#include<windows.h>
#include<stdlib.h>
void gotoxy(int x,int y)
{
HANDLE hcon;
hcon = GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwPos;
dwPos.X = x;
dwPos.Y= y;
SetConsoleCursorPosition(hcon,dwPos);
}
main()
{
system("cls");
int clave;
int op,op1,op2,op3,saldo,DEPOSITOS,RETIROS,CONSULTAS,SALIR,ingreso,retirar,trans;
saldo=500;
gotoxy(16,2);printf ("|************ **** **+*+");
gotoxy(16,3);printf ("| ************ *** +*+*+*+");
gotoxy(16,4);printf ("| ************ *** *+*+*+*");
gotoxy(16,5);printf ("| ************* **** *+* *+*+");
gotoxy(16,6);printf ("| ************ ** ** *+* *+*+");
gotoxy(16,7);printf ("| *********** ** *** *+* *+*+");
gotoxy(16,8);printf ("| ************ ** *** *+* *+*+");
gotoxy(16,9);printf ("| ************* ** *** *+* *+*+");
gotoxy(16,10);printf("| ************** ** *** *+* *+*+");
gotoxy(16,11);printf("| ************* ** *** *+* *+*+");
gotoxy(16,12);printf("| ************ ** **** +* *+*+");
gotoxy(16,13);printf("| *********** ** ***** *+*+");
gotoxy(16,14);printf("| *********** ** *+*+");
gotoxy(16,15);printf("|************ ** *+*+");
gotoxy(33,20);printf(" !~Bienvenido~!");
gotoxy(3,22);printf("Por favor digite su clave de acceso[ ]");
gotoxy(40,22);scanf("%i",&clave);
while(clave!=1105)
{
system("cls");
gotoxy(3,10);printf("Clave incorrecta");
gotoxy(2,15);printf("Vuelva a digitar la clave de acceso[ ]");
gotoxy(39,15);scanf("%i",&clave);
getch();
}
do
{
system("cls");
gotoxy(25,15);printf("+-------------------------+");
gotoxy(25,17);printf("| CAJERO AUTOMATICO |");
gotoxy(25,19);printf("| DEPOSITOS...........1 |");
gotoxy(25,21);printf("| RETIROS.............2 |");
gotoxy(25,23);printf("| CONSULTAS...........3 |");
gotoxy(25,25);printf("| SALIR...............4 |");
gotoxy(25,27);printf("| ESCOJA UNA OPCION.[ ]|");
gotoxy(25,29);printf("+-------------------------+");
gotoxy(48,27);scanf("%d",&op);
switch(op)
{
case 1:
system("cls");
gotoxy(32,2);printf("+**~DEPOSITOS~**+");
gotoxy(16,4);printf("~ Introduzca la cantidad que desea depositar:[ ]");
gotoxy(63,4);scanf("%i",&ingreso);
saldo=saldo+ingreso;
gotoxy(24,6);printf ("****El saldo de su cuenta es %i****",saldo);
gotoxy(25,13);printf("Desea otra trans []s/n");
getch();
break;
case 2:
system("cls");
gotoxy(32,2);printf("+**~RETIROS~**+");
gotoxy(16,4);printf ("Introduzca la cantidad a retirar:[ ] ");
gotoxy(50,4);scanf ("%i",&retirar);
if (retirar>saldo)
{
gotoxy(23,4);printf ("No dispone de tanto dinero en su cuenta");
gotoxy(23,5);printf ("El saldo disponible es: %i dolares",saldo);
}
else
{
saldo=saldo-retirar;
gotoxy(24,6);printf ("Ha retirado %i dolares",retirar);
gotoxy(24,7);printf ("Su saldo final es: %i dolares",saldo);
}
gotoxy(25,13);printf("Desea otra trans s/n[]");
getch();
break;
case 3:
system("cls");
gotoxy(32,2);printf("+**~CONSULTAS~**+");
gotoxy(23,5);printf ("El saldo de su cuenta es: %i dolares",saldo);
gotoxy(25,13);printf("Desea otra trans [s/n]");
getch();
break;
case 4:
system("cls");
gotoxy(23,7);printf( "~~****** ~** **~ ");
gotoxy(23,8);printf( " ~* ** +*** *** ");
gotoxy(23,9);printf( " * +** +** * ** ");
gotoxy(23,10);printf(" ~* ** +** ** ");
gotoxy(23,11);printf("~~****** $ ~** **~ " );
gotoxy(15,14);printf("GRACIAS POR UTILIZAR NUESTROS SERVICIOS ");
gotoxy(23,15);printf("FUE UN PLACER ATENDERLE ");
break;
default:
system("cls");
printf("Error....vuelva a digitar la opción correcta");
getch();
}
}
while(op!=4);
getch();
}
No hay comentarios:
Publicar un comentario