Advertisement
Joao_Joao

Questão 1 Lista de Exercícios IFPB

Apr 25th, 2022
548
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.   int x, sum = 0, i = 1;
  5.   for(;i<=3;++i) {
  6.     printf("Digite o valor do numero %d: ", i);
  7.     scanf("%d", &x);
  8.     sum += x;
  9.   }
  10.   printf("A media aritmetica dos 3 numeros eh: %.2f\n", sum / 3.0);
  11.  
  12.   return 0;
  13. }
Advertisement
RAW Paste Data Copied
Advertisement