Detailed overview of C Language Function [Tutorial]

Function

Functions:
Function is a set of instructions to carry out a particular task. The Function after processing returns a single value.
In other word, we say a Function is a group of statements that can perform any particular task. 

Types of functions:
Types of Functions

There are two types of Functions in C
  1. Standard Functions  (Pre-defined Functions)

  2. User-defined Functions

 1. Standard functions:
All standard functions, such as sqrt() , pow() , log() , sin() etc. are porvided in the library of the functions. The standard functions are also called library functions or built in functions. Predefined Functions are already created. Eg: printf() , scanf() , getch() , clrscr() etc.

2. User defined functions:
User defined Functions which are created by the User according to his need.

Function Defination:
Defining a function means writing an actual code for a function. Suppose you are defining a function which computes the square of a given number. Then you have to write a set of instructions to do this. There are different methods to define functions. The following two ways are used in defining functions:
  1. NON ANSI style

  2. ANSI style

1. NON ANSI style
The general form of NON ANSI function definition is as follows:

type name_of_the_function (parameter list)
parameter definition;
{
variable declaration;
stmt 1; 
stmt2;
.......
.......
return(value_computed);
}

where
  • type => The data type of the return value by the function. 

  • name_of_the_function => This is a user-defined function name.

  • parameter list => List of variables that recieve, the value from the calling function. 

  • parameter definition => Type declaration of the variables of the parameter list.

  • return => A keyword used to send the output of the function, back to the calling function. There may be one or more return statements. When return is e

0 Response to "Detailed overview of C Language Function [Tutorial]"

Post a Comment

Popular Posts

Label

1 Sidebar 2 Columns 3 Columns Footer 3rdball 4 Columns Footer Alex Alvaro Antsasia Arlinadesign Averie Barry BASIC CONCEPTS Basil Bayna Fast BeautyPress BeautyTemplates Beckel Best Best - Clean Beyonce Pro BioMag BlackMag Blanter Nova Blogger Card Bloggertheme9 Blogish Bpress Brakt C LANGUAGE C PROGRAMS C++ LANGUAGE C++ PROGRAMS Carella Cellar Charlotte Chooko Lite Clara Clean Combo One Cooperate Crusade Darry Dorman Dreamway Dunia Blanter eCars EduAcademy EducationPress Elise Elvan Eva Everyday FabNews Fashion Fashion Blogger Template Fashion Gossip FastCars Fedo FlashNews Fredy Portfolio Gaming Globus GoodTime Goomsite HTML LANGUAGE iGaming Indicate Innove Insomnia InspiredNews iSoft Jasmine Kalem Landscaping Lashira Lavelle Lily Fashion Limax Linea Lionex Luminescence Lite Lumix Luxury Magazine MagazinePro MAJOR DIFFERENCES MarketingBlog Martin MaxiMag Medica Mega Melissa Mercury MeshMag Minimag Minimalist MiniNews MovieKhor msdesignbd MusicLand Neko NetZine New Spread News16 Newsflash NewsForce NewsIdea Newspaper News NewsPro Nubie Fast Odd Themes Optima PaperMag PaperMag blog Parhlo Perfection Personal Personal Blog Photosout PixelZ Power Blog Premium Themes ProfileMag Purez Rano ReadNews Real estate Remito Grid Responsive Revo Robusta Rotario Saara SeoBoost Settle Shouters Simple Catch SimpleClean Sketchly SNews SolidMag Someo Sophie Sora Sora Bank Sora Home Sora News Responsive Sora One Sora Ribbon Spido Sticko Stucco Sure Mag Swift Tech Tech Pro Techia Techmax TechSpot TemplateClue Templateism Templatesilk Templatesyard Templatezy The Freelancer TheBlogger TheFocus Themeforest Themexpose TIPS AND TRICKS Topside TravelMag Trendy Trendy Travel Tumblr Under Construction Uong Jowo Veethemes Vertox VideoPlay Vigo Waverly way2themes WebBiz Wedding X-Mag Zealer ZetaMag