The compiler doesn't mark it as any error.
Here is the program.
You are using wrong specifier for
int data type. Its undefined behavior. Any thing could happen.
Anything at all can happen; the Standard imposes no requirements. The program may fail to compile, or it may execute incorrectly (either crashing or silently generating incorrect results), or it may fortuitously do exactly what the programmer intended.
Your program behaviour is undefined since
%s is not a valid format specifier for an
Exactly why it gives you the values it does is down to conjecture. The compiler also reserves the right to eat your cat. And your dog given that
void main() is not compliant with later C standards.
C intentionally does not guard against your doing this as that would compromise the performance of the language. It's difficult (although not impossible as C is statically typed) for a compiler to warn you of this.
It shows you not name of the company. Compiler treats
6 as pointer and prints character data from that address until it finds escape sequence
If you compile this code with different compiler, you will most likely get different results, thats why it is called undefined behavior, as it been rightfully pointed in other answers.
First of all you should really start to use the minimum standard.
There are a lot of code missing in here and of course you are using an invalid format specifier.
You started with an
int but you try to print it as a String (%d vs %s)
Also your Main Function it's not ok and the return type is missing too.
This is what you need: