for loop runs infinitely and it prints 1 infinitely when I run the below code.
#include<stdio.h>
#include<conio.h>
void main(){
int i,n;
scanf("%d", &n);
for(i=1;i<=n;i+2){
printf("%d",i);
}
getch();
}
If the input of n= 10
Actual Output:
11111111111111111111111111111111111111111111111111.......
Expected Output:
13579
I want to know why 1 is printed infinitely.