Logica de Programacion

Páginas: 4 (817 palabras) Publicado: 24 de septiembre de 2014
LOGICA DE PROGRAMACION
EJERCICIOS

27 DE FEBRERO DE 2014
UTT
IVAN LOPEZ DIAZ

UNIVERSIDAD TECNOLOGICA DE
TEHUACAN

INGENIERIA EN MECATRÓNICA
Catedrático:
M.C. NELSON SOSA MACMAHOM
IVANLOPEZ
DIAZ

1

EJERCICIOS DE PROGRAMACIÓN
PROBLEMAS SECUENCIALES
1. Escriba un programa que solicite al usuario que introduzca dos números y obtenga e imprima la
suma, el producto, ladiferencia, el cociente y el módulo de los dos números.
#include
#include
int main(int argc, char *argv[])
{
printf("\t***PRIMER EJERCICIO***\n");
int A,B,C;
printf("INGRESE PRIMER NUMERO\n");scanf("%d",&A);
printf("INGRESE SEGUNDO NUMERO\n");
scanf("%d",&B);
C=A+B;
printf("*LA SUMA DE LOS NUMERO ES:%d*\n",C);
C=A-B;
printf("*LA RESTA DE LOS NUMERO ES:%d*\n",C);
C=A*B;
printf("*LAMULTIPLICACION DE LOS NUMEROS ES:%d*\n",C);
C=A/B;
printf("*LA DIVICION DE LOS NUMEROS ES:%d*\n",C);
C=A%B;
printf("*EL MODULO DE LOS NUMEROS ES:%d*\n",C);
system("pause");
return 0;
}

2

2.Leer la entrada de dos números y mostrar el doble producto del primero menos la mitad del
segundo.
#include
#include
int main(int argc, char *argv[])
{
float A,B,C,X,Y;
printf("INGRESA ELPRIMER NUMERO\n");
scanf("%f",&A);
printf("INGRESA EL SEGUNDO NUMERO\n");
scanf("%f",&B);
C=A*2;
X=B/2;
Y=C-X;
printf("EL RESULTADO ES:%f\n",Y);
system("pause");
return 0;
}

3. Lea sunombre, apellido paterno, apellido materno y matricula, y escríbala en un solo renglón,
separando con tabuladores:
#include
#include

int main(int argc, char *argv[])
{
charnombre[15],apellido1[15],apellido2[15];
int A;
printf("MATRICULA DEL ALUMNO\n");
scanf("%d",&A);

3

printf("NOMBRE DEL ALUMNO\n");
scanf("%s",&nombre);
printf("APELLIDO PATERNO DEL ALUMNO\n");scanf("%s",&apellido1);
printf("APELLIDO MATERNO DEL ALUMNO\n");
scanf("%s",&apellido2);
printf("%d\t%s\t%s\t%s\t\n",A,nombre,apellido1,apellido2);
system("pause");
return 0;
}
4. Escribir un programa para lea...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Programacion Logica
  • Programacion Logica
  • logica y programacion
  • lógica de programación
  • Programacion Logica
  • LOGICA DE PROGRAMACIÓN
  • LOGICA DE PROGRAMACION
  • Logica De Programacion

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS