C   90

soma

Guest on 27th April 2022 02:05:14 AM

  1. #include <stdio.h>
  2.  
  3. int soma (int a, int b) {
  4.   return (a + b);
  5. }
  6.  
  7. int main () {
  8.   int a, b;
  9.  
  10.   printf ("Digite o valor de a: ");
  11.   scanf ("%d", &a);
  12.  
  13.   printf ("Digite o valor de b: ");
  14.   scanf ("%d", &b);
  15.  
  16.   printf ("Soma de a e b: %d\n", soma(a, b));
  17.   printf ("Soma de 5 e 10: %d\n", soma(5, 10));
  18.  
  19.   return 0;
  20. }

Raw Paste


Login or Register to edit or fork this paste. It's free.