0% found this document useful (0 votes)
7 views2 pages

Practica 4

Uploaded by

carlosmartinezrf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Practica 4

Uploaded by

carlosmartinezrf
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include<stdio.

h>
#include<conio.h>
#include<windows.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);
}

void Multi (int x,int n);


int Suma (int x, int n);
void Resta (void);

int main(void)
{
int opc, n,x,S;
do
{
system("cls");
gotoxy(60,5);
printf("M E N U");
gotoxy(30,7);
printf("1.- Tabla de Multiplicar");
gotoxy(30,9);
printf("2.- Tabla de Sumar");
gotoxy(30,12);
printf("3.- Tabla de Restar");
gotoxy(30,14);
printf("4.- Salir");
gotoxy(70,17);
printf("Seleccionar opcion: ");
scanf("%d", &opc);
system("cls");
switch(opc)
{
case 1:
gotoxy(40,10);
printf("¿Que tabla necesitas? ");
x=1;
do
{
Multi(x,n);
x:x+1;
}while(x<=10);
break;
case 2:
gotoxy(40,10);
printf("¿Que tabla necesitas?");
scanf("%d",&n);
x=1;
while(x<=10)
{
S=Suma(x,n);
gotoxy(40,15);
printf("%d+%d=%d", n,x,S);
x++;
}
break;
case 3:
Resta();
break;
case 4:
gotoxy(60,15);
printf("Fin del sistema");
break;
default:
gotoxy(40,10);
printf("S A L I R");
break;

deafult:
gotoxy(40,10);
printf("OPCION INVALIDA");

}
getch();
}while(opc!=4);
return 0;
}
void Multi (int x,int n)
{
int M;
M=n*x;
gotoxy(50,15);
printf("%d * %d = %d",n,x,M);
}
int Suma (int x, int n)
{
int S;
S=n+x;
return S;
}
void Resta (void)
{
int n,x,R;
gotoxy(40,10);
printf("¿Que tabla necesitas ? ");
scanf("%d",&n);
for (x=1; x<=n; x++)
{
R=n-x;
}
}

You might also like