Skip to content

Instantly share code, notes, and snippets.

@manvscode
Created May 25, 2022 15:40
Show Gist options
  • Save manvscode/dd5c90580d1e102f5a7ad151b9c0b46b to your computer and use it in GitHub Desktop.
Save manvscode/dd5c90580d1e102f5a7ad151b9c0b46b to your computer and use it in GitHub Desktop.
Is first or second molar?
#include <stdio.h>
#include <stdbool.h>
static bool is_first_molar(int tooth)
{
return tooth % 10 == 6;
}
static bool is_second_molar(int tooth)
{
return tooth % 10 == 7;
}
int main()
{
int max_fdi_number = 88;
printf("First Molars: ");
for( int i = 0; i < max_fdi_number; i++ )
{
if( is_first_molar(i) )
{
printf("%d ", i);
}
}
printf("\n");
printf("Second Molars: ");
for( int i = 0; i < max_fdi_number; i++ )
{
if( is_second_molar(i) )
{
printf("%d ", i);
}
}
printf("\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment