Electronic Circuits - Electronic Tutorials - Electronic Hobby Projects - A Complete Electronic Resource Centre

C Language Programming Library Reference Guide

Products

Sitemap

Online
Calculators

Circuits (A-C)

Circuits (D-O)

Circuits (P-Z)

Tutorials


 
Google
 
Web Hobbyprojects.com

Statements - return

The return statement causes the current function to terminate. It can return a value to the calling function. A return statement can not appear in a function whose return type is void. If the value returned has a type different from that of the function's return type, then the value is converted. Using the return statement without an expression creates an undefined result. Reaching the } at the end of the function is the same as returning without an expression.

Syntax:

return expression;
Examples:
int alice(int x, int y)
 {
  if(x<y)
    return(1);
  else
    return(0);
}
 
 
 
Search
Custom Search

<<<  Back to C Language Library Reference Guide

<<<  Back to Electronics Tutorials