Subscribe For Free Updates!

We'll not spam mate! We promise.

Sunday, 26 August 2012

C++ code to display result of university semester



//Displyaing result
//Programmer name: Sohail ahmed
//Date: 10-03-2010

#include<iostream.h>
#include<conio.h>

int main()
{
clrscr();
float asg_marks, quiz_marks, mterm_marks, fterm_marks;
float result;

cout<<"\nEnter asssignment marks between (0&20): ";
cin>>asg_marks;
cout<<"\nEnter quiz marks between (0&10): ";
cin>>quiz_marks;
cout<<"\nEnter mid term marks between (0&20): ";
cin>>mterm_marks;
cout<<"\nEnter final term marks between (0&50): ";
cin>>fterm_marks;

result=asg_marks+quiz_marks+mterm_marks+fterm_marks;

if(result>=87 && result<=100)
cout<<"\nThe grade is A";
else if(result>=80)
cout<<"\nThe grade is B+";
else if(result>=71)
cout<<"\nThe grade is B";
else if(result>=66)
cout<<"\nThe grade is C+";
else if(result>=60)
cout<<"\nThe grade is C";
else if(result>=50)
cout<<"\nThe grade is D";
else if(result<=49 && result>=0)
cout<<"\nThe grade is F";
else
cout<<"\nInvalid option!";
getch();
return 0;
}

Socializer Widget By CodingLovers
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment