Skip to main content

Step by step descriptive logic to find total, average and percentage.

Step by step descriptive logic to find total, average and percentage.BY GOOGLE SEARCH

1) Input marks of five subjects. 
2) Store it in some variables say eng, phy, chem, math and comp.
3) Calculate sum of all subjects and store in total = eng + phy + chem + math + comp.
4) Divide sum of all subjects by total number of subject to find average i.e. 
5) average = total / 5.
Calculate percentage using percentage = (total / 500) * 100.
Finally, print resultant values total, average and percentage.
    Program 

/**
 * C program to calculate total, average and percentage of five subjects
 */

#include <stdio.h>

int main()
{
    float eng, phy, chem, math, comp; 
    float total, average, percentage;

    /* Input marks of all five subjects */
    printf("Enter marks of five subjects: \n");
    scanf("%f%f%f%f%f", &eng, &phy, &chem, &math, &comp);

    /* Calculate total, average and percentage */
    total = eng + phy + chem + math + comp;
    average = total / 5.0;
    percentage = (total / 500.0) * 100;

    /* Print all results */
    printf("Total marks = %.2f\n", total);
    printf("Average marks = %.2f\n", average);
    printf("Percentage = %.2f", percentage);

    return 0;
}

Comments

Popular posts from this blog

Classification of Networks Based on Geographical Classification

               ***Classification of Networks Based on Geographical Classification***                   In this section ,we will discuss the following categories of networks.                                                                                                                 PAN ...

TELNET (Terminal Network)

TELNET Telnet is (Terminal Network) and it was proposed as a standard of TCP/IP protocol for a virtual terminal service. If any user want to establish a connection this TELNET helps to that user. You can also say it the advantage of TELNET. FEATURES OF TELNET:- 1) it has local or remote login, network virtual terminal and time sharing environment.   ð    REMOTE LOGIN = mainly internet and TCP (Transfer Control Protocol) have been designed to provide many services to user. If user wants to access an application program residing on remote computer. He can do it using TELNET.   ð    TIME SHARING ENVIRONMENT = 1 st this was developed or created when all the operating systems was operating on time sharing principle. And in the time sharing principle there is a large central computer which supports all the users.   ð    LOCAL LOGIN = login of user into the local time sharing system is called as “local login”. As Shown In Figure below… ...

Types of server, all types of server file server, print server, application server, database server, message server information.

                                                                                                                    Types of Servers Hi today’s blog is on types of Servers. You can take knowledge of types of servers blog in marathi मराठी. Link https://myblogs0727.blogspot.com/2020/05/blog-post_11.html?m=1 Servers are those who connects us to the internet or links us to a good internet (net) service that we uses the connection of the service.        Server is the thing that serves the service to us i.e. end users, in other words it plays roll like servant which serves us ...