Music...where 3 + 3 = 5.
Ie c to e is a third, and e to g is a third, but c to g is a fifth.
4 + 3 = 7
#define TRUE 1
#define FALSE !TRUE
void print_key();
void show_scale();
double power();
char notes[13][3]={"A ","A#","B ","C ","C#","D ","D#","E ","F ","F#","G ","G#","A "};
char scale_name[8][12]={"Ion(M)","Dor","Phryg","Lyd","Mixolyd","Aeol(m)","Locr"};
int scale[16]={2,2,1,2,2,2,1,2,2,1,2,2,2,1};
int main()
{
int key=3,i,its;
printf("\nWelcome to Scale Printer.\n\n");
do
{
print_key(key); printf("\n");
for(i=0;i<=6;i++)
{
show_scale(key,i,scale_name[i]);
printf("\n");
}
key = (key + 7) % 12;
its++;
printf("\n");
} while(its<12);
return 0;
}
void print_key(int key)
{
int i;
printf("Key of %s\t:",notes[key]);
for (i=0;i<13;i++) printf("%s ",notes[(key+i) % 12]);
}
void show_scale(int key,int mode,char \*modename)
{
int i,j,scale_note;
scale_note=key;
printf("%s of %s\t:",modename,notes[key]);
for(i=0;i<8;i++)
{
printf("%s",notes[scale_note]);
scale_note = (scale_note + scale[i+mode]) % 12;
printf(" ");
for(j=1;j < scale[i+mode];j++) printf(" ");
}
}Not really as most professional musicians understand the problem, but it shows that no instrument can be “perfectly” tuned.
(3-1) + (3-1) = (5-1)