URI Problem 1040 (Average 3) solution( Bangla ) | C language

** Before watching the solution please make sure that you have tried enough **

#include <stdio.h>

int main()
{
    float a, b, c, d, e, i, j, k;
    double avg, avrg;
    scanf("%f %f %f %f", &a, &b, &c, &d);
    avg = ((a*2) + (b*3) + (c*4) + d) / 10;
    printf("Media: %.1lf\n", avg);
    if ( avg < 5.0 ){
        printf("Aluno reprovado.\n");
    }
    else if( avg >= 7.0 ){
        printf("Aluno aprovado.\n");
    }
    else{
        printf("Aluno em exame.\n");
        scanf("%f",&e);
        printf("Nota do exame: %.1f\n",e);
        avrg = (avg+e) / 2;
        if ( avrg >= 5.0 ){
            printf("Aluno aprovado.\n");
        }
        else {printf ("Aluno reprovado.\n");
        }
        printf("Media final: %.1lf\n",avrg);
    }

    return 0;

}

 

You can find video explanation of this solution in our YouTube channel. You will find the YouTube channel link in the top right corner.
Like our Facebook page and SUBSCRIBE to our YouTube channel.
Stay connected.

If you face any problem, let me know in the comment section.

Leave a Comment