Hello!
I've just started an introduction course in C programming at the University. I am currently struggling on the last exercise of an mandatory assignment.
Its probably some basic stuff, but we were asked to make a program that counts from 1-50, which i have following code for;
Code:
#include <stdio.h>
int main(void)
{
int i;
for (i=0; i <= 50; i=i+1)
{printf("%d\n", i);
}
This code works just fine, but the follow-up question is giving me a headache. We are asked to make the program to point out if the numbers are even or odd (with an "if" statement!).
Example:
1 is an odd number
2 is an even number
.... etc
Hope you are able to help
edit: Sorry about some misspellings, the assignment isnt given in english.