From 97a693d996c79fb2a008b19750d8bb45512e01a2 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Mon, 6 Feb 2017 11:26:44 -0500 Subject: Inital commit --- forsin.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 forsin.c (limited to 'forsin.c') diff --git a/forsin.c b/forsin.c new file mode 100644 index 0000000..23e7250 --- /dev/null +++ b/forsin.c @@ -0,0 +1,18 @@ +/* File: forsin.c + calculate the function sinc(x) = sin(x)/x + for x from -10 to 10 with step size 5 */ + +#include +#include + +int main() +{ + int x; + printf("%3c | %5s\n",'x',"sinc(x)"); + printf("-------------\n"); + for(x=-10;x<=10;x+=5) + { + printf("%3i | %6.3f\n",x,sin(x)); + } + return 0; +} -- cgit v1.2.3-70-g09d2