Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links



C : Implementation of sin(),pow(),sqrt()

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 30-01-2010
Member
 
Join Date: Dec 2009
Posts: 27
C : Implementation of sin(),pow(),sqrt()

I am the student of the Bachelor of science in Information Technology. I have know about the C language. I find the problem while coding to find the sin, power and square root of the given number in the C program. I want to know how can I find sin, square root and power of the using the standard library functions. I also want know how can I implement these functions in my C program. Thus, Anyone knows about the these functions ? Please, Help me!!
Reply With Quote
  #2  
Old 30-01-2010
Reegan's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,299
C : Implementation of sin(),pow(),sqrt()

I think the sin() function, pow() function and sqrt() function are the functions of the header files that are contained in in the library files. To use sin() function, pow() function and sqrt() function in the program you need to import the math.h files from the library. This could be possible by defining the # include<math.h> at the start of the C program. After defining, you could be able to use these functions from library. I hope it will help's you.
Reply With Quote
  #3  
Old 30-01-2010
Member
 
Join Date: May 2008
Posts: 1,990
Re: C : Implementation of sin(),pow(),sqrt()

Yes, I know about sin() function, pow()function and sqrt() functions. The math.h file is a header file basically designed for most of the mathematical operations, in the C programming language. The sin() function, pow()function and sqrt() functions are contained in the math.h header file. Most of the functions involve the use of floating point numbers. These sin() function, pow()function and sqrt() functions can be used to return the angle, float or long doubles, etc.
Reply With Quote
  #4  
Old 30-01-2010
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
Implementation of sin(),pow(),sqrt()

According to my knowledge, The sin() function can be used to return the sin angle of the given arc, for e.g. sin(e) can returns the sine of e.
The pow() function can be used to return the power of the given number, for e.g. pow(3,2) can returns 8.
The sqrt() function can be used to return the square root of the given number, for e.g. sqrt(4) can returns 2.
Reply With Quote
  #5  
Old 30-01-2010
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
Program

#include <stdio.h>
#include <math.h>
int main(void)
{
double y = 0.31415926;
double rs = sin(y);
printf(" The sine of %f is %f \n", y, rs);
printf(" pow(3, 2) = %f \n ", pow(3, 2));
printf(" The square root of %f is %lf\n", y, rs);
return 0;
}
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "C : Implementation of sin(),pow(),sqrt()"
Thread Thread Starter Forum Replies Last Post
network implementation jonnitwo Networking & Security 1 17-03-2011 12:37 AM
What is the sqrt() : C++ Garrick Software Development 4 09-03-2010 05:06 PM
C : Implementation of ctime() Gavyn Software Development 4 01-02-2010 04:21 PM
Implementation of vsprintf() : C Gaelic Software Development 4 28-01-2010 11:28 AM
Implementation of mysql Aloke Software Development 5 23-01-2010 01:26 AM


All times are GMT +5.5. The time now is 04:00 AM.