-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsin.c
More file actions
66 lines (50 loc) · 1.04 KB
/
sin.c
File metadata and controls
66 lines (50 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#include<stdio.h>
#include<math.h>
void swap(int&,int&); //Call by reference..
int main()
{
int a=10,b=20,c;
printf("\nBefore a=%d b=%d",a,b);
swap(a,b); //pass by value method, call by value/.....Pass by Pointers
printf("\nAfter Swapping a=%d b=%d",a,b);
return 0;
}
void swap(int &a,int &b)//Local Variables
{
int c;
c=a;
a=b;
b=c;
printf("\n In Function a=%d b=%d",a,b);
}
/*
// {
// double x,ax,ss=0,sin_x=0,t;
// int i,n,sign=-1;
// printf("Enter x: ");
// scanf("%f", &x);
// printf("Enter n: ");
// scanf("%d", &n);
// //converting degree into radian
// printf("%d",n);
// ax=x;
// x = x*(3.14159/180);
// for(i=1;i<=n;i=i+2)
// {
// sign = -sign;
// t= sign*pow(x,i)/fact(i);
// sin_x = t + sin_x;
// }
// printf("Sin(%.2lf) Using Functionality: %f", ax,sin_x);
// ss = sin(x);
// printf("\nSin(%.2lf) Using Math.h: %f",ax,ss);
}
// int fact(int n)
// {
// int i,fact=1;
// for(i=1;i<=n;i++)
// {
// fact=fact*i;
// }
// return fact;
// }*/