- #1
sheldonrocks97
Gold Member
- 66
- 2
Homework Statement
Write a C program to read values for times from the input file times.txt; compute sin(5*pi*t) for each time t given in times.txt; output comma separated values of t, sin(5*pi*t) into an output file named output.csv; and compile the program using a makefile. Hand in a copy of your program, output file, and makefile.
LIST OF TIMES:
0
0.0121
0.0241
0.0362
0.0483
0.0603
0.0724
0.0845
0.0965
0.1086
0.1207
0.1327
0.1448
0.1569
0.1689
0.1810
0.1931
0.2051
0.2172
0.2293
0.2413
0.2534
0.2655
0.2775
0.2896
0.3017
0.3137
0.3258
0.3379
0.3499
0.3620
0.3741
0.3861
0.3982
0.4103
0.4223
0.4344
0.4465
0.4585
0.4706
0.4827
0.4947
0.5068
0.5189
0.5309
0.5430
0.5551
0.5671
0.5792
0.5913
Homework Equations
The Attempt at a Solution
#include<stdio.h>
#include<math.h>
void main (void)
{
FILE *times.txt, *output.csv; //input/output files//
int t; //time variable//
int x = sin(5*M_PI*t);Please help my friend and I are very very desperate!