This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.3

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.3

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.3

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Detailed Software Testing Tutorials and Interview Questions.3

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Friday 31 August 2012

Calculating Percentage & Grade


#include <stdio.h>
#include <conio.h>

void main()
{
        int sub1, sub2, sub3, sub4, sub5;
        float total, percentage;

        clrscr();

        printf("\n\n\n***Program to Calculate Grade***\n\n\n");

        printf("Enter the obtained marks of Subject 1 : ");
        scanf("%d",&sub1);

        printf("Enter the obtained marks of Subject 2 : ");
        scanf("%d",&sub2);

        printf("Enter the obtained marks of Subject 3 : ");
        scanf("%d",&sub3);

        printf("Enter the obtained marks of Subject 4 : ");
        scanf("%d",&sub4);

        printf("Enter the obtained marks of Subject 5 : ");
        scanf("%d",&sub5);

        total = sub1+sub2+sub3+sub4+sub5;
        percentage = ((float)total/500)*100;

        printf("\n\nYour Total marks is %.f",total);
        printf("\nYour Percentage is %.2f",percentage);

        if(percentage>40)
        {
                if(percentage>60)
                {
                        if(percentage>80)
                        {
                                printf("\nYour Grade is A.");
                        }
                        else
                        {
                                printf("\nYour Grade is B.");
                        }
                }
                else
                {
                        printf("\nYour Grade is C.");
                }
        }
        else
        {
                printf("\n\nHome Guidance is necessary.");
        }

        getch();
}