Skip to content

Instantly share code, notes, and snippets.

@uroybd
Created July 14, 2016 17:19
Show Gist options
  • Save uroybd/90e0f43cbc0c95dd70a88ecd0a29288e to your computer and use it in GitHub Desktop.
Save uroybd/90e0f43cbc0c95dd70a88ecd0a29288e to your computer and use it in GitHub Desktop.
URI 1118
#include <stdio.h>
int main()
{
int r, c;
float n, s;
do{
c=0;
s=0.0;
while(c<2)
{
scanf(“%f”, &n);
if(n>=0.0 && n<=10.0)
{
c++;
s = s + n;
}
else
{
printf(“nota invalida\n”);
}
}
printf(“media = %.2f\n”, s/2.0);
do{
printf(“novo calculo (1-sim 2-nao)\n”);
scanf(“%d”, &r);
}while(r!=1 && r!=2);
}while(r!=2);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment