Can someone help me .No matter what i do i just cant get this C program to properly compile and run .I keep getting these errors during the compiling process.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Can someone help me .No matter what i do i just cant get this C program to properly compile and run .I keep getting these errors during the compiling process.
In function '
warning: implicit declaration of function '
displayTriTab (degrees);
At top level:
warning: conflicting types for '
void displayTriTab (int degrees) {
note: previous implicit declaration of '
displayTriTab (degrees);
A
/tmp/cc8shLrA.o: In function displayTriTab':
trigTable.c: (.text+0xf1): undefined reference to 'sin'
trigTable.c: (.text+0x110): undefined reference to `cos'
trigTable.c: (.text+0x12f): undefined reference to 'tan'
collect2: error: ld returned 1 exit status
[-Wimplicit-function-declaration]
' [enabled by default]
was here
Transcribed Image Text:In function ' warning: implicit declaration of function ' displayTriTab (degrees); At top level: warning: conflicting types for ' void displayTriTab (int degrees) { note: previous implicit declaration of ' displayTriTab (degrees); A /tmp/cc8shLrA.o: In function displayTriTab': trigTable.c: (.text+0xf1): undefined reference to 'sin' trigTable.c: (.text+0x110): undefined reference to `cos' trigTable.c: (.text+0x12f): undefined reference to 'tan' collect2: error: ld returned 1 exit status [-Wimplicit-function-declaration] ' [enabled by default] was here
#include<stdio.h>
#include<math.h>
void displayTritab (int degrees);
int main() {
}
}
int degrees;
printf("Welcome to trigTable.\n");
printf("This program will print a table of trigonometric values\n");
printf("from 0 to 360 degrees in increments selected by the user.\n\n");
printf("Please the select the number of degrees for the increment: ");
scanf("%d", &degrees);
displayTriTab (degrees);
printf("\nThank you for using trigTable. Bye!\n");
return 0;
void displayTriTab (int degrees) {
const double PI = acos (-1.0);
printf("\t---\tTRIGONOMETRIC TABLE\t---\t\n\n");
printf("%-10%-10s%-10s%-10s%-10s\n", "Degrees", "Radians", "Sine", "Cosine", "Tangent");
for (int i = 0; i <= 360; i+= degrees)
{
double radians = i* (PI / 180.0);
double sin_val= sin (radians);
double cos_val= cos (radians);
double tan_val= tan (radians);
if (i == 90 || 1==270)
printf("%-10d%-10.4f %-10.4f %-10.4f %-10s\n", i, radians, "N/A", cos_val, "N/A");
printf("%-10d%-10.4f % -10.4f %-10.4f % -10.4f\n", i, radians, sin_val, cos_val, tan_val);
else
}
"trigTable.c" 47L, 1344C
Transcribed Image Text:#include<stdio.h> #include<math.h> void displayTritab (int degrees); int main() { } } int degrees; printf("Welcome to trigTable.\n"); printf("This program will print a table of trigonometric values\n"); printf("from 0 to 360 degrees in increments selected by the user.\n\n"); printf("Please the select the number of degrees for the increment: "); scanf("%d", &degrees); displayTriTab (degrees); printf("\nThank you for using trigTable. Bye!\n"); return 0; void displayTriTab (int degrees) { const double PI = acos (-1.0); printf("\t---\tTRIGONOMETRIC TABLE\t---\t\n\n"); printf("%-10%-10s%-10s%-10s%-10s\n", "Degrees", "Radians", "Sine", "Cosine", "Tangent"); for (int i = 0; i <= 360; i+= degrees) { double radians = i* (PI / 180.0); double sin_val= sin (radians); double cos_val= cos (radians); double tan_val= tan (radians); if (i == 90 || 1==270) printf("%-10d%-10.4f %-10.4f %-10.4f %-10s\n", i, radians, "N/A", cos_val, "N/A"); printf("%-10d%-10.4f % -10.4f %-10.4f % -10.4f\n", i, radians, sin_val, cos_val, tan_val); else } "trigTable.c" 47L, 1344C
Expert Solution
steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Top down approach design
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education