-1
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
float bonus_a_receber(float salario, float perc){
float a_pagar;
a_pagar = (salario * perc) / 100;
return a_pagar;
}
int main(int argc, const char * argv[]){
setlocate(LC_ALL, "portuguese");
float sal, per, total;
printf("Digite o seu salário: ");
scanf("%f", $sal);
printf("Digite o percentual do bonus: ")
scanf("%f", per);
total = bonus_a_receber(sal, per);
printf("Bonus a receber R$ %.2f\n", total);
return 0;
}
Output
Digite o seu salário: Program ended with exit code: 01000
Digite o percentual do bonus: 10
Bonus a receber R$ 100.00
Can anyone tell me why when compiling in Xcode this code in C it presents the message below? PS In other compilers the message is not shown...
Program ended with Exit code: 01000
Thank you!
Well, in previous versions, if you try to output Target on the console, it will remove the line from the output code. However, in newer versions of Xcode, you get stuck with it if you create a command line project. The code contains no errors.
– Luis Fernando Garcia
Hello @redronew. Avoid placing images of your code, instead edit your question and put there the formatted code.
– João Martins
How much you put in salary ?
1000
? It seems to me that the text has been overlaid, and that the exit code is0
and stuck to the1000
incoming, giving01000
. That is "Program ended with Exit code: 0" and then the "1000"– Isac
In the scanf function we must provide the address of the variable that will receive the value: scanf("%f", &sal); scanf("%f", &per);
– anonimo
Isac... Really, after the compilation the message "Program ended with Exit code: 01000" is superimposed exactly where I enter the input data in the console......
– redronew