-4
Follows an excerpt from the code:
#include <stdio.h>
#include <stdlib.h>
#define MVAIN 0.8592;
#define MVAOUT 1.0282;
#define ICMS 0.29;
float ProdValue = 0, MVA = 0, ResultValue1 = 0, ResultValue2 = 0, ResultValue3 = 0;
int main(){
printf("Indique o valor dos produtos da nfe que contenham ST \n");
scanf ("%f", &ProdValue);
printf ("O valor dos produtos é: %f \n ", &ProdValue);
printf ("Informe se o MVA é fora ou dentro do estado \n");
scanf ("%f", &MVA) ;
if(MVA == 1) {
ResultValue1 = ProdValue*MVAIN; //926,23
ResultValue2 = ResultValue1+ProdValue; //2004,25
ResultValue3 = ResultValue2*ICMS; //581,23
ResultValue2 = ResultValue1-ResultValue2; //345,00
printf ("O valor a recolher é %0.2f \n", ResultValue2);
} if (MVA == 2) {
ResultValue1 = ProdValue*MVAOUT; //926,23
ResultValue2 = ResultValue1+ProdValue; //2004,25
ResultValue3 = ResultValue2*ICMS; //581,23
ResultValue2 = ResultValue1-ResultValue2; //345,00
printf ("O valor a recolher é %0.2f \n", ResultValue2);
What is the problem? Note that monetary value cannot be
float
but I don’t think this is the problem. http://answall.com/q/38138/101. This code neither compiles. What value should you enter to test?– Maniero
It even compiles, actually missing the code snippet, note that it ends in a "printf", I have his exe here, however the float values do not receive the stipulated value, for example 1078.02. When I try to assign this value he does not receive. I tried to print on the screen the values however remain zeroed even after the assignments, this for attribution by input as direct.
– xDjulio
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero