Charles,
I'm getting the following error(s) trying to compile your Exam1.c example.
jrs@laptop:~/B4A/xfer/O2/CLessons$ gcc Exam1.c -o Exam1
/tmp/ccNKDx5v.o: In function `ShowHWaves':
Exam1.c:(.text+0x40d): undefined reference to `sin'
Exam1.c:(.text+0x431): undefined reference to `sin'
/tmp/ccNKDx5v.o: In function `ShowVWaves':
Exam1.c:(.text+0x57a): undefined reference to `sin'
Exam1.c:(.text+0x5a1): undefined reference to `sin'
/tmp/ccNKDx5v.o: In function `ShowVWaves2':
Exam1.c:(.text+0x757): undefined reference to `sin'
collect2: ld returned 1 exit status
jrs@laptop:~/B4A/xfer/O2/CLessons$
Here are the results of trying to compile Exam2.c.
jrs@laptop:~/B4A/xfer/O2/CLessons$ gcc Exam2.c -o Exam2
Exam2.c: In function ‘q14’:
Exam2.c:28:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[8]’ [-Wformat]
/tmp/ccTEqgnz.o: In function `Qxxx':
Exam2.c:(.text+0x39f): undefined reference to `pow'
collect2: ld returned 1 exit status
jrs@laptop:~/B4A/xfer/O2/CLessons$
My error!
I forgot to add -lm to my gcc command line.
Exam2.c still has the following warning. BTW: If you enter a letter instead of a number, the program goes into an endless loop.
jrs@laptop:~/B4A/xfer/O2/CLessons$ gcc Exam2.c -lm -o Exam2
Exam2.c: In function ‘q14’:
Exam2.c:28:5: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[8]’ [-Wformat]
jrs@laptop:~/B4A/xfer/O2/CLessons$