# C C++ program to find total percent and division

## C C++ program to find total percent and division

If statement और decision making statements के बारे में अधिक जानने के लिए देखें— If statements in C

Unconditional branching statements के बारे में अधिक जानकारी के लिए देखें— Break, Continue and Goto in C

### C program to find total percent and division

``````#include<stdio.h>
int main()
{
int s1,s2,s3,s4,s5,t;
float p;
printf("Enter marks of five subjects:\n");
scanf("%d%d%d%d%d",&s1,&s2,&s3,&s4,&s5);
t=s1+s2+s3+s4+s5;
p=t/5.0;
printf("Total    = %d\n",t);
printf("Percent  = %f\n",p);
if(p>=60)
printf("Division = First");
else if(p>=45)
printf("Division = Second");
else if(p>=33)
printf("Division = Third");
else
printf("Division = Fail");
return 0;
}``````

### C++ program to find total percent and division

``````#include<iostream>
using namespace std;
int main()
{
int s1,s2,s3,s4,s5,t;
float p;
cout<<"Enter marks of five subjects: "<<endl;
cin>>s1>>s2>>s3>>s4>>s5;
t=s1+s2+s3+s4+s5;
p=t/5.0;
cout<<"Total    = "<<t<<endl;
cout<<"Percent  = "<<p<<endl;
if(p>=60)
cout<<"Division = First";
else if(p>=45)
cout<<"Division = Second";
else if(p>=33)
cout<<"Division = Third";
else
cout<<"Division = Fail";
return 0;
}``````

### Output of C C++ program to find total percent and division

```Enter marks of five subjects:
40 50 60 70 81
Total     =  301
Percent   =  60.200001
Division  =  First```
```Enter marks of five subjects:
4 5 6 7 8
Total     =  30
Percent   =  6.000000
Division  =  Fail```

Share it to: