Input Marks and Print Remarks C Program

How to write a program to input marks and print remarks in C Programming Language ?


Solution:
//Program to input marks and print remarks.
#include<stdio.h>
#include<conio.h>

void main()
{
int number_1, number_2, number_3;
float avg;

clrscr();

printf("Enter marks of three subjects: ");
scanf("%d%d%d", &number_1, &number_2, &number_3);

avg = (number_1 + number_2 + number_3) / 3;

if(avg > 90)
printf("Excellent! :D");
else if(avg > 70)
printf("Good! :) ");
else if(avg > 50)
printf("Satisfactory. :/ ");
else if(avg > 32)
printf("Just pass... -_-");
else
printf("Fail. XD");

getch();
}


Learn More :