Advertisement
FollowTheMedia

Simplest C main and sum function

Nov 28th, 2012
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int A(int x, int y);
  4.  
  5. int main (void) {
  6.   int result;
  7.   int primo, secondo;
  8.   printf("Inserire 2 numeri\n");
  9.   printf("Primo: ");
  10.   scanf("%d",&primo);
  11.   printf("\nSecondo: ");
  12.   scanf("%d",&secondo);
  13.   printf("\nLa loro somma vale %d\n", A(primo,secondo));
  14.   return 0;
  15. }
  16.  
  17. int A(int x,int y){
  18.   return x + y;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement