Write a C++ Program to find the average of six subjects and display the Result as follows.


SUBMITTED BY: Nrupeshsinh

DATE: June 25, 2016, 12:14 p.m.

FORMAT: Text only

SIZE: 536 Bytes

HITS: 362

  1. # include<iostream.h>
  2. # include<conio.h>
  3. void main()
  4. {
  5. clrscr();
  6. int i,m[6],sum=0;
  7. float avg;
  8. for(i=0; i<6; i++)
  9. {
  10. cout<<"Enter Marks :"<<i+1<<endl;
  11. cin>>m[i];
  12. sum+=m[i];
  13. }
  14. avg=sum/6;
  15. cout<<"Average :"<<avg;
  16. if(avg<35)
  17. {
  18. cout<<"Fail";
  19. }
  20. else if(avg>35&&avg<=50)
  21. {
  22. cout<<"third Division";
  23. }
  24. else if(avg>50&&avg<=60)
  25. {
  26. cout<<"Second Division";
  27. }
  28. else if(avg>60&&avg<=75)
  29. {
  30. cout<<"First Division";
  31. }
  32. else if(avg>75&&avg<=100)
  33. {
  34. cout<<"Distinction";
  35. }
  36. getch();
  37. }

comments powered by Disqus