repl.it
@maniero/

FormatDouble.c

C

No description

fork
loading
Files
  • main.c
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <stdio.h>

int main() {   
    double nota1, nota2;
    printf("Escreva a nota 1: ");
    scanf("%lf", &nota1);
    printf("\nEscreva a nota 2: ");
    scanf("%lf", &nota2);
    printf("\nA media ponderada e: ");
    printf("%.2lf", (nota1 * 2 + nota2 * 3) / 5);
}

//https://pt.stackoverflow.com/q/411447/101