[E-5]
Write a main()
program that first
asks the user for an integer, N, and the prints the first N odd integers starting
with 1, one per line. The output of the program is:
Enter N: 7 1 3 5 7 9 11 13
Here is a skeleton of the program :
#include <stdio.h> #include <stdlib.h> /* Puzzle L07 -- print the first N odd integers. Ask the user for N. */ int main() { int j, N; printf("Enter N: "); scanf("%d", &N ) for ( ) { printf("%3d\n", ); } return 0; }
Try to write a nice, conceptually clean program. It is easy to make this program messier than it needs to be.
Thinking about odd and even is surprisingly common in programming, so this program is good practice.