how to display answer of tan(PI/2) using mikroc?

Status
Not open for further replies.

naya2013

Newbie level 2
Joined
Oct 19, 2013
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
62
answer of tan(pi/2) how can display using mikroc?when i tried.but (pi) undeclared e identifier 'pi' in expression.help me......?
 


Code C - [expand]
1
2
3
4
5
6
7
8
9
void main(){
 
      const Pi = 3.14159265;
      double tanVal = 0.0;
 
      tanVal = tan(pi / 2.0);
     
      while(1);
}

 


Code C - [expand]
1
2
3
4
5
6
7
8
9
void main(){
 
      const Pi = 3.14159265;
      double tanVal = 0.0;
 
      tanVal = tan(pi / 2.0);
     
      while(1);
}


there is a problem.we know tan(pi/2.0)=0.02742243
but how can we display it using lcd?
 


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
unsigned char sTanVal[23] = "";
 
void main(){
 
      const Pi = 3.14159265;
      double tanVal = 0.0;
 
      tanVal = tan(pi / 2.0);
      FloatToStr(tanVal, sTanVal);
      Lcd_Out(1,1,sTanVal);
      while(1);
}

 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…