Monday, August 2, 2021

C++ Program to find total marks of five subjects and percentage.

C++ Program to find total marks of five subjects and percentage.

#include<iostream.h>

#include<conio.h>

void main()

{

 long int t,s1,s2,s3,s4,s5;

double p;

 clrscr();

 cout<<"\nEnter Marks for Subject1 : ";

 cin>>s1;

 cout<<"\nEnter Marks for Subject2 : ";

 cin>>s2;

 cout<<"\nEnter Marks for Subject3 : ";

 cin>>s3;

 cout<<"\nEnter Marks for Subject4 : ";

 cin>>s4;

 cout<<"\nEnter Marks for Subject5 : ";

 cin>>s5;

 t=s1+s2+s3+s4+s5;

p=(t*100)/500;

 cout<<"\nTotal Marks = "<<t;

 cout<<"\nPercentage = "<<p;

 getch();

}

 

   

No comments:

Post a Comment

12th January Swami Vivekanand Jayanti: National Youth Days

The day serves as a reminder to the youth of India to remain steadfast in their goals and contribute positively to society. Swami Vivekanand...