Created
July 14, 2016 17:19
-
-
Save uroybd/90e0f43cbc0c95dd70a88ecd0a29288e to your computer and use it in GitHub Desktop.
URI 1118
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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