TOPIC

Erro de loop

Kitkat asked 2 years ago

c 

#include<stdio.h>
#include<stdlib.h>

int main(){
  double n1, n2, me=0;
  int i;

  while( scanf("%lf%lf", &n1, &n2)){

  if((n1 >= 0.0 && n1 <=10.0) && (n2 >= 0.0 && n2 <=10.0)) {
    me = (n1 + n2)/2;
    printf("media = %.2lf\n");
  } else {
    printf("nota inválida\n");
  }

  i++;

}

return 0;
}

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.