0
I am in personal studies following a booklet that this algorithm gives the following result:
Algorithm of the Apostille
#include <stdio.h>
#include <conio.h>
main() {
int n = 10;
int m = ++n;
printf("\n N=%d M=%d",n,m);
int a = 10;
int x = a++;
printf("\n A=%d, X=%d",a,x);
}
The result comes out this value:
N = 11 M= 11
A=11 X=10
The amount they put in the booklet was:
N=10 M=11
A=10 X=10
What’s wrong with it? I didn’t get the result they put in the workbook... My algorithm is identical to the workbook.
Apostille link: https://www.apostilando.com/apostila/3353/apostila-structuraL-data apostille.
– Devprogramacao
I believe the workbook is wrong, the prefix first increases the n then sends to m, the post-fixed sends the value of a to x first, then increases the
– FourZeroFive
Got it. Thanks @Four
– Devprogramacao