Naikon

11-02-2007, 03:22 AM

Hi, I am very new to C programming.

I have stumbled on this problem for a while now, and anyone who could point me in the right direction with this, I thank you.

Basically, the user inputs a value for N, where the program prints a list of the odd integers less than N.

I want the program to print the odds such as (1,3) etc less than N.

I am a beginner, so please excuse my code:o

Here is the code:

#include <stdio.h>

#include <conio.h>

void main()

{

int k;

int N;

int sum;

printf("please enter a value for variable N: \n");

scanf("%d" , &N);

k=2;

k = k+1;

do

{

k = k+1;

} while ( k < N && k*k < N );

printf("the number of odds is: %d\n" , sum);

getch();

}

I have stumbled on this problem for a while now, and anyone who could point me in the right direction with this, I thank you.

Basically, the user inputs a value for N, where the program prints a list of the odd integers less than N.

I want the program to print the odds such as (1,3) etc less than N.

I am a beginner, so please excuse my code:o

Here is the code:

#include <stdio.h>

#include <conio.h>

void main()

{

int k;

int N;

int sum;

printf("please enter a value for variable N: \n");

scanf("%d" , &N);

k=2;

k = k+1;

do

{

k = k+1;

} while ( k < N && k*k < N );

printf("the number of odds is: %d\n" , sum);

getch();

}