Program to add two numbers.
#include <stdio.h>
int add( int, int ) ; /* prototype — need to indicate types only */
void main ( )
{
int x, y ;
puts ( “Enter two integers “) ;
scanf( “%d %d”, &x, &y) ;
printf( “%d + %d = %d\n” , x, y, add(x,y) ) ;
}
int add ( int a, int b )
{
int result ;
result = a + b ;
return result ; // parentheses used for clarity here
}