===========================================================================
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float p,o,i,u,y,t;
char l[20];
cout<<"Enter Your NAME: ";
cin>>l;
cout<<"\n Enter marks of Maths (out of 100) : ";
cin>>p;
cout<<"\n Enter marks of English (out of 100) : ";
cin>>o;
cout<<"\n Enter marks of Sanskrit (out of 100) : ";
cin>>i;
cout<<"\n Enter marks of Science (out of 100) : ";
cin>>u;
cout<<"\n Enter marks of Social Science (out of 100) : ";
cin>>y;
t=(p+o+i+u+y)/5;
if(t>0 && t<36)
{cout<<"\n"<<l<<" sorry you are Fail!!!! go study";}
else if(t>35 && t<61)
{cout<<"\n"<<l<<" your grade is \"C\" need to work hard";}
else if(t>60 && t<81)
{cout<<"\n"<<l<<" your grade is \"B\" go home and get lost";}
else
{cout<<"\n"<<l<<" your grade is \"A!!\" ";}
getch();
}
CODING
#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
float p,o,i,u,y,t;
char l[20];
cout<<"Enter Your NAME: ";
cin>>l;
cout<<"\n Enter marks of Maths (out of 100) : ";
cin>>p;
cout<<"\n Enter marks of English (out of 100) : ";
cin>>o;
cout<<"\n Enter marks of Sanskrit (out of 100) : ";
cin>>i;
cout<<"\n Enter marks of Science (out of 100) : ";
cin>>u;
cout<<"\n Enter marks of Social Science (out of 100) : ";
cin>>y;
t=(p+o+i+u+y)/5;
if(t>0 && t<36)
{cout<<"\n"<<l<<" sorry you are Fail!!!! go study";}
else if(t>35 && t<61)
{cout<<"\n"<<l<<" your grade is \"C\" need to work hard";}
else if(t>60 && t<81)
{cout<<"\n"<<l<<" your grade is \"B\" go home and get lost";}
else
{cout<<"\n"<<l<<" your grade is \"A!!\" ";}
getch();
}
===========================================================================
No comments:
Post a Comment