Created
February 6, 2013 03:16
-
-
Save josefsalyer/4719944 to your computer and use it in GitHub Desktop.
Remember to create a list of the steps using comments you want your program to perform so that you can keep track of your completeness as you go.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.c | |
// Loops | |
// | |
// Created by Curt on 2/5/13. | |
// Copyright (c) 2013 Curt. All rights reserved. | |
// | |
#include <stdio.h> | |
int main(int argc, const char * argv[]) | |
{ | |
//count backwards by 3 from 99 to 1 | |
for (int x = 99; x > 0; x -= 3) // <-- see how I declared x's type as an int inside the loop? there's a reason. | |
{ | |
//see what numbers are divisible evenly by 5 | |
if (x % 5 == 0) | |
{ | |
//tell me when you find one | |
printf("Found one! - %d.\n", x); | |
} | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment