My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

My code just prints an infinite loop of "1".

Gustavo Rodrigues da Silva's photo
Gustavo Rodrigues da Silva
·Feb 13, 2020

"Do a program which will read an integer number N and then will print the odd natural numbers that come before the typed number."

```#include <stdio.h>

int main(){

int n,o;

printf("Type an integer number:\n");

scanf("%d",&n);

o=1;

while(o<n){

printf("%d\n",o);

o+2;

}

} ```