Wednesday 1 March 2017

Program to find the division of student in C++ language

Example program of ladder if-statement
 
#include <iostream.h>
 
int main ()
{
  int a,b,c,d,total,perc;
 
  cout<<”\n Enter marks of four subjects:”;
  cin>>a>>b>>c>>d;
  
  total = a+b+c+d;
  perc = total*100/400; // finding percentage of marks
  
  if(perc>=60)
  {
     cout<<”\n your division is : First”;
  }
  else if(perc>=45)
  {
     cout<<”\n your division is : Second”;
  } 
  else if(perc>=30)
  {
     cout<<”\n your division is : Third”;
  } 
  else 
  {
     cout<<”\n you are Fail”;
  } 
 
  return 0;

}

No comments:

Post a Comment