programa de suma y multiplicacion de numeros enteros

3
//PROGRAMA QUE SUMA Y MULTIPLICA 2 NUMEROS DECIMALES //USANDO FUNCIONES. ARGENIS GIL.UFT #include <stdio.h> #include <cmath.h> #include <stdlib.h> float uno; //primer numero float dos; //segundo numero float suma_total; float mult_total; void operaciones(); float suma(float a, float b); float multiplicacion(float a, float b); main(){ char op; while(op!='x' && op!='X'){ clrscr(); printf("Presione 1 para iniciar el programa \ n"); printf("Presione 'x' para Salir \n"); op=getchar(); switch(op){ case '1':

Upload: argenis-gil

Post on 27-Jun-2015

605 views

Category:

Technology


2 download

DESCRIPTION

PROGRAMA BASICO BASADO EN C++ PARA SUMAR Y MULTIPLICAR NUMEROS ENTEROS Y ASI VERIFICAR SUS FUCIONES.

TRANSCRIPT

Page 1: PROGRAMA DE SUMA Y MULTIPLICACION DE NUMEROS ENTEROS

//PROGRAMA QUE SUMA Y MULTIPLICA 2 NUMEROS DECIMALES //USANDO FUNCIONES. ARGENIS GIL.UFT

#include <stdio.h>

#include <cmath.h>

#include <stdlib.h>

float uno; //primer numero

float dos; //segundo numero

float suma_total;

float mult_total;

void operaciones();

float suma(float a, float b);

float multiplicacion(float a, float b);

main(){

char op;

while(op!='x' && op!='X'){

clrscr();

printf("Presione 1 para iniciar el programa \n");

printf("Presione 'x' para Salir \n");

op=getchar();

switch(op){

case '1':

operaciones();

break;

}

Page 2: PROGRAMA DE SUMA Y MULTIPLICACION DE NUMEROS ENTEROS

}

return 0;

}

float suma(float a, float b)

{

float x;

x = a + b;

return x;

}

float multiplicacion(float a, float b)

{

float x;

x = a * b;

return x;

}

void operaciones()

{

float a;

float b;

clrscr();

printf("Introduzca el primer numero: ");

scanf("%f",&a);

printf("Introduzca el segundo numero: ");

scanf("%f",&b);

Page 3: PROGRAMA DE SUMA Y MULTIPLICACION DE NUMEROS ENTEROS

suma_total = suma(a,b);

mult_total = multiplicacion(a,b);

printf("La multiplicacion de los dos numeros es: %f \n",mult_total);

printf("La multiplicacion de los dos numeros es: %f \n",suma_total);

}