C

C program to calculate grades of n students from 3 tests using arrays3 min read

In this tutorial of C programs, our task is to write a c program that checks if student result as pass or fail.

To understand this program you must have idea about: if-else decision and for loop making statement




if else:

if statement we found that code inside if block is executed only when condition is found to be true. But what to do in case condition is false.

This is where if-else statement comes handy.

First see the syntax given below,

for loop:

‘For loop’ is helpful when we need to execute a statement or a block of statement repeatedly and number of iteration required is known.

Syntax:

Problem: Write a program in C that asks from N Students to enter 3 marks to calculate and print his/her grade based on the average marks. 

The answer to this question is given below:

Solution: C program to calculate grades of 5 students from 3 tests using arrays

You may also like: C Code Examples

Output:

C program to calculate grades of n students from 3 tests using arrays
C program to calculate grades of n students from 3 tests using arrays

C program to find grade of a student using for loop,
C program to find grade of a student using if else,
C program to find grade of a student.

Leave a Comment