Wednesday, January 16, 2013

C Language Example # 03 Simple Result Generator Based on Input Marks of 7 Subject

C Language Example # 03 Simple Result Generator Based on Input Marks of 7 Subject

Lets move ahead with some more example.....


C Language Code:

//Written by Latest Technology Guide   
//Title : Example 03 : Simple Result Generator Based on Input Marks of 7 Subject .
 
#include <stdio.h>
#include <conio.h>
void main()
{
    clrscr();
    float m1,m2,m3,m4,m5,m6,m7,result,total,percentage;

    printf("Enter Marks of All Subject (7 Subject) :\n");
    scanf("%f %f %f %f %f %f %f",&m1,&m2,&m3,&m4,&m5,&m6,&m7);

    total=m1+m2+m3+m4+m5+m6+m7;
    percentage=total/7.0;

    if(m1>=36 && m2>=36 && m3>=36 && m4>=36 && m5>=36 && m6>=36 && m7>=36)
    {
        printf("\nTotal   \t : %.2f",total);
        printf("\nResult\t\t : Pass");
        printf("\nPercentage \t : %.2f",percentage);
    }
    else
        printf("\nResult\t : Fail");

    getch();
}


Output:

We think there is no need of Output for this program.


--------------------------------------------------------------------------------
Explanation of C Language Example # 03 : Simple Result Generator Based on Input Marks of 7 Subject

* We have assume that subjects are 7.
* Passing Mark is 36. Means if student secures 36 or more marks then he/she will be passed in the subject.
* If student is passed then we are calculating total marks, result and percentage


.Note: All programs are developed and tested using Turbo C++ 3.0 under Windows XP. We just want to provide guidelines to the users. If you are using any other Compiler or other operating system they you need to modify this program as per your requirements. 

No comments:

Post a Comment