2 votes 2 votes what will be output and please explain how? #include<stdio.h> #include<conio.h> void main(){ int i; for(i=1;i<5;i++) { printf("%d",i); if(i=3){ break; } } } Programming and DS programming-in-c + – mohit kumar 5 asked Jan 16, 2018 mohit kumar 5 198 views answer comment Share Follow See 1 comment See all 1 1 comment reply joshi_nitish commented Jan 17, 2018 reply Follow Share code will print '$1$' and then break from the for loop. $if(i=3)$, here 'if condition' is always true irrespective of a value of 'i', because ($=$) is assignment operator rather than comparison operator ($==$) 1 votes 1 votes Please log in or register to add a comment.
1 votes 1 votes Answer will be 1 because after that i has been assigned a value equal to 3. which will break the loop. (i=3) will be always true since '=' is assignment operator and '==' is commparison operator. pandit_shubhanshu answered Jan 17, 2018 pandit_shubhanshu comment Share Follow See all 0 reply Please log in or register to add a comment.