Hello,
this is my 1st post just wanted to know why is 1 of the below program not working and one of them is working even though both mean exactly same??
1)
Code:#include "conio.h" #include "stdio.h" void main() { int i; if(i==1) { float n=3; } else { float n=5; } }
2)
Also tell me why is the declaration allowed in between. I mean in C variables can never be declared in between then how is the 1st code working??can anybody tell me the solution?i'll be very grateful to him..Code:#include "conio.h" #include "stdio.h" void main() { int i; if(i==1) float n=3; else float n=5; }