Calculator to find Percentage of mark obtained by using C Program

 CODE:-

#include <stdio.h>


int main()

{

    float s,m,n,e,p;

    float a,ap;

    printf("Enter the mark obtained in Science= ");

    scanf("%f",&s);

    printf("Enter the mark obtained in Math= ");

    scanf("%f",&m);

    printf("Enter the mark obtained in nepali= ");

    scanf("%f",&n);

    printf("Enter the mark obtained in english= ");

    scanf("%f",&e);

    printf("Enter the mark obtained in Population= ");

    scanf("%f",&p);

    if(s,m,n,e,p<0 || s,m,n,e,p>100)

    {

        printf("invalid input plz correct the input mark...");

    }

    else

    {

        a=s+m+n+e+p;

        ap=a*100/500;

        printf("Total Aggreate mark obtained is:- %f\n",a);

        printf("Total Percentage obtained is:- %f",ap);

        printf(" percentage");

    }

    return 0;

}


Comments

Popular posts from this blog

Tips to improve Coding Skill