+ 1
Why is the output of this code vary to compiler? 😐
#include<stdio.h> main() { int a=5; printf("%d %d %d", ++a, a,a++) ; }
8 ответов
+ 2
Since u are returning 0, your header should be int main() and not simply main()
+ 1
Modern compilers may complain about main function return type being undefined or be set to void.
About the why ...
https://stackoverflow.com/questions/4176328/undefined-behavior-and-sequence-points
+ 1
What are the outputs you get? And what compilers r being used?
+ 1
Are you sure this code output varies with compiler.? I think it's not
+ 1
Azhagesan yeah.. i checked.. other versions of codeblocks show different output..
0
I think it should be by default integer.. (edited).. then the real ans plz. ❤
0
775 in codeblocks IDE(version 17.12)
GNU GCC compiler
0
Mohammad Hasan but thats just only one you have used