Skip to content

Instantly share code, notes, and snippets.

@zamith
Created January 9, 2013 23:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zamith/4497818 to your computer and use it in GitHub Desktop.
Save zamith/4497818 to your computer and use it in GitHub Desktop.
#include <stdio.h>
void print_ages(int age) {
int i;
int number_of_trips = 0;
for (i = 0; i <= age; i++)
{
if(i % 8 == 0 && i % 5 != 0) {
printf("%i\n", i);
number_of_trips++;
}
}
printf("Number of trips: %i\n", number_of_trips);
}
int main() {
char* str = "Hello World";
int age = 85;
print_ages(age);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment