![]() |
Programming in C - Kinda stuck
The idea:
Using looping methods and the IF constrcut to print the numbers between 1 and 10 along with an idications of whether each is even or odd. Like this 1 is odd 2 is even 3 is odd Using C My attempt: /* Name: Cameron Owen CIC Y1 G1 Software Development Mathmatics */ Code:
#include <stdio.h>I know there are other ways to do this without the need to use a maths division but that would only work for the numbers i choose. My idea is, if a number is divisable by 2 and gives a remainder 0. Then its even If a number is divisable by 2 and gives a remiander 1. It is odd Many thanks if you help me on this, Cameron |
Re: Programming in C - Kinda stuck
You have posted it as an Article under the Article / Source code section. I have moved it to the Queries and Discussion forum.
Also please use the bbcode for the code snippets you put in. |
Re: Programming in C - Kinda stuck
Just replace the dowhile loop with the following
Code:
do{ |
| All times are GMT +5.5. The time now is 05:32. |