Advertisement
tomateblue

Soma em C com Scanf

Jun 14th, 2016
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.   int n1,n2,total;
  6. // get n1
  7.   printf("n1: ");
  8.   scanf("%d",n1);
  9. // get n2
  10.   printf("n2: ");
  11.   scanf("%d",n2);
  12. // soma total
  13.   total = n1 + n2; // soma
  14.   printf("Soma: %i",total);
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement