Advanced features of c, C/C++ Programming

Assignment Help:

  We are now quite happy to use the basic mathematical expressions, however in engineering we use scientific functions i.e Sin , Cos  , ln etc . Within C we have the following functions

    double atan(double);
    double cos(double);
    double exp(double);
    double fabs(double);
    double log(double);
    double sin(double);
    double sqrt(double);
    double tan(double);
    double acos(double);
    double asin(double);
    double atan2(double, double);
    double ceil(double);
    double cosh(double);
    double floor(double);
    double fmod(double, double);
    double frexp(double, int *);
    double ldexp(double, int);
    double log10(double);
    double modf(double, double *);
    double pow(double, double);
    double sinh(double);
    double tanh(double);
 
  These are similar to the scientific functions on a calculator. We can print out the square root of 4 by assigning the function to a variable i.e.
 
    A =4;
    answer = sqrt(A);   or

    answer = sqrt(4);
 
The overall format of any function is a function name and the value (parameters) passed to it and returned. Within  C  we have only have a single type of function and one value can only be returned ( Although there are tricks to get around this

The syntax of a function is
 
type Function name(type variable, type variable etc )
  {
    Any local variables used by the function
    Function program
 
    return ( variable or value ); 
  }
 
Some important points regarding functions are that the Variables declared are local which means that the main program doesn't see them. The return commands variable is the only parameter returned. Within C all functions should have a prototype description. This is a single line statement which informs the compiler of the type of variables used in the function. In fact the description of the maths functions are in fact prototype headers. This is time to introduce a new type i.e. 'void', by default C takes no type as int, therefore void means no variable.


Related Discussions:- Advanced features of c

User-defined data type, Explain  U s e r - D e f i n e d D a t a...

Explain  U s e r - D e f i n e d D a t a T y p es? C has Union and Structure as user-defined data types.  C++ has class which looks like structure with a

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Prime no., program to find if a no . is prime or not

program to find if a no . is prime or not

Define the relational operator in c language, Define the Relational Operato...

Define the Relational Operator in c language? The Relational operators refer to the relationships that values can have with one another and they are used to compare two operand

., what is polymorphism

what is polymorphism

Define the stream oriented data files, Define the Stream Oriented Data File...

Define the Stream Oriented Data Files? There are two dissimilar types of data files called stream-oriented (or standard) data files and system-oriented (or low-level) data file

Using c language, I have a program and I want someone to fix it for me by u...

I have a program and I want someone to fix it for me by using basic c language program.

Data structyres, What data structure would you mostly likely see in a nonre...

What data structure would you mostly likely see in a nonrecursive implementation of a recursive algorithm?Minimum 100 words accepted#

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd