C program to read marks and print percentage and division (2024)

  • Home
  • DS & Algo. ▾
    • Data Structure
    • Algorithms
    • Coding Problems
  • Languages ▾
    • C
    • C++
    • C++ STL
    • Java
    • Python
    • Scala
    • Ruby
    • C#.Net
    • Golang
    • Android
    • Kotlin
    • SQL
  • Web. ▾
    • JavaScript
    • CSS
    • jQuery
    • PHP
    • Node.Js
    • AdonisJs
    • VueJS
    • Ajax
    • HTML
    • Django
  • Programs ▾
    • C
    • C++
    • Data Structure
    • Java
    • C#.Net
    • VB.Net
    • Python
    • PHP
    • Golang
    • Scala
    • Swift
    • Rust
    • Ruby
    • Kotlin
    • C Interview Programs
  • Aptitude ▾
    • C Aptitude
    • C++ Aptitude
    • Java Aptitude
    • C# Aptitude
    • PHP Aptitude
    • Linux Aptitude
    • DBMS Aptitude
    • Networking Aptitude
    • AI Aptitude
    • More...
  • Interview ▾
    • Golang
    • MIS Executive
    • DBMS
    • C
    • Embedded C
    • Java
    • SEO
    • HR
  • Find Output ▾
    • C
    • C++
    • C#.Net
    • Java
    • Go
    • PHP
    • More...
  • MCQs ▾
    • Web Technologie MCQs
    • CS Subjects MCQs
    • Databases MCQs
    • Programming MCQs
    • Testing Software MCQs
    • Digital Mktg Subjects MCQs
    • Cloud Computing S/W MCQs
    • Engineering Subjects MCQs
    • Commerce MCQs
    • More MCQs...
  • CS Subjects ▾
    • Machine Learning/AI
    • Operating System
    • Computer Network
    • Software Engineering
    • Discrete Mathematics
    • Digital Electronics
    • Data Mining
    • MIS
    • DBMS
    • Embedded Systems
    • Cryptography
    • CS Fundamental
    • More Tutorials...
  • More ▾
    • Tech Articles
    • Puzzles
    • Full Forms
    • Code Examples
    • Blogs
    • Guest Post
    • Programmer's Calculator
    • XML Sitemap Generator
    • About
    • Contact

Home »C solved programs »C basic programs

In this C program, we are going to read marks in 3 subjects, we will find the total, percentage and print the division based on the percentage.
Submitted by Manju Tomar, on October 09, 2017

Problem statement

Given (or input from the user) marks in 3 subjects and we have to calculate parentage and print the division.

Formula to get percentage

Formula to get percentage: Total obtained marks *100/Grand total (total of maximum marks)

Conditions to find division

Division

Based on the percentage, we will print the division, if percentage is:

  1. Greater than or equal to 60, division will be "First"
  2. Greater than or equal to 50, division will be "Second"
  3. Greater than or equal to 40, division will be "Third"
  4. Less than it (we will not check any condition, it will be written in else), the result will be fail

C program to read marks and print percentage and division

#include<stdio.h>int main(){int science; int math;int english;int total;float per;science = 50;math = 90;english = 40;//you can take input from user instead of these values//calculating totaltotal= science + math + english;//calculating percentageper= (float) total*100/300;printf("Total Marks: %d\n",total);printf("Percentage is: %.2f\n",per);//checking division and printingif(per>=60){printf("First division\n");}else if(per>=50){printf("Second division");}else if(per>=40){printf("Third division");}else{printf("Fail\n");}return 0;}

Output

Total Marks: 180Percentage is: 60.00First division

This is a simple C program, if you are a beginner you will learn to calculate total, percentage and how to find division (example of multiple if else).

If liked or any issue with the program, feel free to leave your comment.

C Basic Programs »

C program to check whether a person is eligible for voting or not?

C program to find gross salary of an employee

Related Programs

  • C program to find subtraction of two integer number
  • C program to find sum and average of two numbers
  • C program to print ASCII value of a character
  • C program to find cube of an integer number using two different methods
  • C program to find quotient and remainder
  • Program to calculate simple interest
  • Program to check whether number is EVEN or ODD
  • Program to find largest number among three numbers
  • C program to check whether a person is eligible for voting or not?
  • C program to read marks and print percentage and division
  • Program to find gross salary of an employee
  • C program to convert temperature from Fahrenheit to Celsius and vice versa
  • C program to calculate X^N (X to the power of N) using pow function
  • C program to find the difference of two numbers
  • C program to print size of variables using sizeof() operator
  • C program to demonstrate examples of escape sequences
  • C program to find area and perimeter of circle
  • C program to find area of a rectangle
  • C program to calculate HCF of two numbers
  • C program to multiply two numbers using plus operator
  • C program to demonstrate example of global and local scope
  • C program to demonstrate example of floor and ceil functions
  • Write a C program to evaluate the net salary of an employee given the following constraints
  • How to swap two numbers without using a temporary variable using C program?
  • C program to read name and marital status of a girl and print her name with Miss or Mrs
  • C program to check given number is divisible by A and B
  • C program to find sum of all numbers from 0 to N without using loop
  • Input hexadecimal value in C language
  • Printing an address of a variable in C
  • printf() statement within another printf() statement in C
  • printf() examples/variations in C
  • C program to calculate profit or loss
  • Calculate the distance between two cities from kilometers to meters, centimeters, feet and inches using C program
  • C program to find area and perimeter of the rectangle
  • C program to generate random numbers within a range
  • C Example to subtract two integers without using Minus (-) operator
  • C Example for different floating point values prediction
  • C Example for nested 'printf'
  • C program to get remainder without using % operator
  • C program to convert ascii to integer (atoi implementation)
  • C program to print ASCII table
  • C program to swap two numbers using four different methods
  • C program to check a given character is alphanumeric or not without using the library function
  • C program to check a given character is a digit or not without using the library function
  • C program to check a given character is a whitespace character or not without using the library function
  • C program to check a given character is an uppercase character or not without using the library function
  • C program to check a given character is a lowercase character or not without using the library function
  • C program to check a given character is a punctuation mark or not without using the library function
  • C program to check whether a character is a printable character or not without using library function
  • C program to convert a lowercase character into uppercase without using library function
  • C program to convert an uppercase character into lowercase without using library function
  • C program to print all punctuation marks without using library function
  • C program to print all punctuation marks using the ispunct() function
  • C program to print all printable characters using the isprint() function
  • C program to print all printable characters without using the library function
  • C program to make a beep sound
  • C program to convert a given number of days into days, weeks, and years
  • C program to find the roots of a quadratic equation
  • C program to find the GCD (Greatest Common Divisor) of two integers
  • C program to find the LCM (Lowest Common Multiple) of two integers
  • C program to calculate the area of a triangle given three sides
  • C program to calculate the area of a triangle given base and height
  • C program to calculate the area of Trapezium
  • C program to calculate the area of the rhombus
  • C program to calculate the area of Parallelogram
  • C program to calculate the area of Cube
  • C program to calculate the volume of Cube
  • C program to find the Surface Area and Volume of the Cylinder
  • C program to calculate the surface area, volume, and space diagonal of cuboids
  • C program to calculate the surface area, volume of Cone
  • C program to calculate the surface area, volume of the Sphere
  • C program to calculate the mean, variance, and standard deviation of real numbers
  • C program to read coordinate points and determine its quadrant
  • C program to calculate the value of nCr
  • C program to calculate the value of nPr
  • C program to calculate the product of two binary numbers
  • C program to calculate the addition of two complex numbers
  • C program to extract the last two digits from a given year
  • C program to perform the ATM Transactions
  • C program to read the height of a person and the print person is taller, dwarf, or average height person
  • C program to read the grade of student print equivalent description

Comments and Discussions!

Load comments ↻


C program to read marks and print percentage and division (2024)
Top Articles
Latest Posts
Article information

Author: Catherine Tremblay

Last Updated:

Views: 5573

Rating: 4.7 / 5 (47 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Catherine Tremblay

Birthday: 1999-09-23

Address: Suite 461 73643 Sherril Loaf, Dickinsonland, AZ 47941-2379

Phone: +2678139151039

Job: International Administration Supervisor

Hobby: Dowsing, Snowboarding, Rowing, Beekeeping, Calligraphy, Shooting, Air sports

Introduction: My name is Catherine Tremblay, I am a precious, perfect, tasty, enthusiastic, inexpensive, vast, kind person who loves writing and wants to share my knowledge and understanding with you.