The keyword return is used to transfer control from a function back to the calling function.
Example:
#include
int add(int, int); /* Function prototype */
int main()
{
int a = 4, b = 3, c;
c = add(a, b);
printf(“c = %dn”, c);
return 0;
}
int add(int a, int b)
{
/* returns the value and control back to main() function */
return (a+b);
}
Output:
c = 7
The keyword return is used to transfer control from a function back to the calling function.
Example:
#include
int add(int, int); /* Function prototype */
int main()
{
int a = 4, b = 3, c;
c = add(a, b);
printf(“c = %dn”, c);
return 0;
}
int add(int a, int b)
{
/* returns the value and control back to main() function */
return (a+b);
}
Output:
c = 7
The keyword return is used to transfer control from a function back to the calling function.
Example:
#include
int add(int, int); /* Function prototype */
int main()
{
int a = 4, b = 3, c;
c = add(a, b);
printf(“c = %dn”, c);
return 0;
}
int add(int a, int b)
{
/* returns the value and control back to main() function */
return (a+b);
}
Output:
c = 7
eAnswers Team
The keyword return is used to transfer control from a function back to the calling function.
Example:
#include
int add(int, int); /* Function prototype */
int main()
{
int a = 4, b = 3, c;
c = add(a, b);
printf(“c = %dn”, c);
return 0;
}
int add(int a, int b)
{
/* returns the value and control back to main() function */
return (a+b);
}
Output:
c = 7
eAnswers Team
The keyword return is used to transfer control from a function back to the calling function.
Example:
#include
int add(int, int); /* Function prototype */
int main()
{
int a = 4, b = 3, c;
c = add(a, b);
printf(“c = %dn”, c);
return 0;
}
int add(int a, int b)
{
/* returns the value and control back to main() function */
return (a+b);
}
Output:
c = 7
eAnswers Team
The keyword return is used to transfer control from a function back to the calling function.
Example:
#include
int add(int, int); /* Function prototype */
int main()
{
int a = 4, b = 3, c;
c = add(a, b);
printf(“c = %dn”, c);
return 0;
}
int add(int a, int b)
{
/* returns the value and control back to main() function */
return (a+b);
}
Output:
c = 7