SlideShare una empresa de Scribd logo
1 de 3
#include <stdio.h>
#include <conio.h>
float Numero1;
float Numero2;
char Temporary[30];
void OutPut(){
float AddFunction();
float MultFunction();
printf("RESULTADO PARA LA SUMA DECIMAL %fn",AddFunction());
printf("RESULTADO PARA LA MULTIPLICACION DECIMAL
%fn",MultFunction());
}
float AddFunction(){
float ShadowVar=0;
ShadowVar= Numero1+Numero2;
return ShadowVar;
}
float MultFunction(){
float ShadowVar=0;
ShadowVar= Numero1*Numero2;
return ShadowVar;
}
void ValidarEntrada()
{
int mistake=0;
do
{
printf ("Introduce valor 1: ");
fgets (Temporary, 30, stdin); /* Nota: Comprobar EOF */
mistake = sscanf (Temporary, "%f", &Numero1); /* Esperamos leer una variable.
Si leemos menos... meeec */
if (mistake<1)
fprintf (stderr, "ERROR EN EL VALOR n");
}while (mistake<1);
do
{
printf ("Introduce valor 2: ");
fgets (Temporary, 30, stdin); /* Nota: Comprobar EOF */
mistake = sscanf (Temporary, "%f", &Numero2); /* Esperamos leer una variable.
Si leemos menos... meeec */
if (mistake<1)
fprintf (stderr, "ERROR EN EL VALOR n");
}while (mistake<1);
}
int main()
{
ValidarEntrada();
AddFunction();
MultFunction();
OutPut();
getche();
}

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Sum2
Sum2Sum2
Sum2
 
PROBLEMAS DE PROGRAMACION 2 por jordan puente quinto
PROBLEMAS DE PROGRAMACION 2 por jordan puente quintoPROBLEMAS DE PROGRAMACION 2 por jordan puente quinto
PROBLEMAS DE PROGRAMACION 2 por jordan puente quinto
 
Bancocic
BancocicBancocic
Bancocic
 
Most Common JavaScript Mistakes
Most Common JavaScript MistakesMost Common JavaScript Mistakes
Most Common JavaScript Mistakes
 
Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3Bcsl 033 data and file structures lab s4-3
Bcsl 033 data and file structures lab s4-3
 
Scan doc0061
Scan doc0061Scan doc0061
Scan doc0061
 
Simulacion - Algoritmo congruencial cuadratico
Simulacion - Algoritmo congruencial cuadraticoSimulacion - Algoritmo congruencial cuadratico
Simulacion - Algoritmo congruencial cuadratico
 
Fibonacci
FibonacciFibonacci
Fibonacci
 
B.f.s
B.f.sB.f.s
B.f.s
 
Bt c cpp_0021
Bt c cpp_0021Bt c cpp_0021
Bt c cpp_0021
 
Program to remove Left factoring
Program to remove Left factoringProgram to remove Left factoring
Program to remove Left factoring
 
Sine prog
Sine progSine prog
Sine prog
 
Var
VarVar
Var
 
listing output program C
listing output program Clisting output program C
listing output program C
 
C Program : Sorting : Bubble,
C Program : Sorting : Bubble, C Program : Sorting : Bubble,
C Program : Sorting : Bubble,
 
Alocação Dinâmica em C
Alocação Dinâmica em CAlocação Dinâmica em C
Alocação Dinâmica em C
 
Mainfinal
MainfinalMainfinal
Mainfinal
 
Ejemplo2
Ejemplo2Ejemplo2
Ejemplo2
 
Operasi pada queue
Operasi pada queueOperasi pada queue
Operasi pada queue
 
Par o impar
Par o imparPar o impar
Par o impar
 

Destacado

27 habits of highly effective and successful people
27 habits of highly effective and successful people 27 habits of highly effective and successful people
27 habits of highly effective and successful people Jake Smolarek
 
12 $uccess habits of Millionaires
12 $uccess habits of Millionaires12 $uccess habits of Millionaires
12 $uccess habits of MillionairesJake Smolarek
 
mynt presentation | jeremyhawkins.net
mynt presentation | jeremyhawkins.netmynt presentation | jeremyhawkins.net
mynt presentation | jeremyhawkins.netmyntjeremy
 
How to be successful in any aspect of life! What high achievers doing differe...
How to be successful in any aspect of life! What high achievers doing differe...How to be successful in any aspect of life! What high achievers doing differe...
How to be successful in any aspect of life! What high achievers doing differe...Jake Smolarek
 
Philosophy, goals and objective of education
Philosophy, goals and objective of educationPhilosophy, goals and objective of education
Philosophy, goals and objective of educationPaulpogz
 

Destacado (12)

Web 2.0
Web 2.0Web 2.0
Web 2.0
 
27 habits of highly effective and successful people
27 habits of highly effective and successful people 27 habits of highly effective and successful people
27 habits of highly effective and successful people
 
Presentation prisma & limas
Presentation prisma & limasPresentation prisma & limas
Presentation prisma & limas
 
Fungsi dan Grafik Fungsi Trigonometri
Fungsi dan Grafik Fungsi TrigonometriFungsi dan Grafik Fungsi Trigonometri
Fungsi dan Grafik Fungsi Trigonometri
 
12 $uccess habits of Millionaires
12 $uccess habits of Millionaires12 $uccess habits of Millionaires
12 $uccess habits of Millionaires
 
mynt presentation | jeremyhawkins.net
mynt presentation | jeremyhawkins.netmynt presentation | jeremyhawkins.net
mynt presentation | jeremyhawkins.net
 
resep masakan
resep masakan resep masakan
resep masakan
 
3 d virtual studio present
3 d virtual studio present3 d virtual studio present
3 d virtual studio present
 
Báo cáo
Báo cáoBáo cáo
Báo cáo
 
Fungsi dan Grafik Fungsi Trigonometri
Fungsi dan Grafik Fungsi TrigonometriFungsi dan Grafik Fungsi Trigonometri
Fungsi dan Grafik Fungsi Trigonometri
 
How to be successful in any aspect of life! What high achievers doing differe...
How to be successful in any aspect of life! What high achievers doing differe...How to be successful in any aspect of life! What high achievers doing differe...
How to be successful in any aspect of life! What high achievers doing differe...
 
Philosophy, goals and objective of education
Philosophy, goals and objective of educationPhilosophy, goals and objective of education
Philosophy, goals and objective of education
 

Rafael vasquez

  • 1. #include <stdio.h> #include <conio.h> float Numero1; float Numero2; char Temporary[30]; void OutPut(){ float AddFunction(); float MultFunction(); printf("RESULTADO PARA LA SUMA DECIMAL %fn",AddFunction()); printf("RESULTADO PARA LA MULTIPLICACION DECIMAL %fn",MultFunction()); } float AddFunction(){ float ShadowVar=0; ShadowVar= Numero1+Numero2; return ShadowVar; } float MultFunction(){ float ShadowVar=0; ShadowVar= Numero1*Numero2; return ShadowVar; }
  • 2. void ValidarEntrada() { int mistake=0; do { printf ("Introduce valor 1: "); fgets (Temporary, 30, stdin); /* Nota: Comprobar EOF */ mistake = sscanf (Temporary, "%f", &Numero1); /* Esperamos leer una variable. Si leemos menos... meeec */ if (mistake<1) fprintf (stderr, "ERROR EN EL VALOR n"); }while (mistake<1); do { printf ("Introduce valor 2: "); fgets (Temporary, 30, stdin); /* Nota: Comprobar EOF */ mistake = sscanf (Temporary, "%f", &Numero2); /* Esperamos leer una variable. Si leemos menos... meeec */ if (mistake<1) fprintf (stderr, "ERROR EN EL VALOR n"); }while (mistake<1); }