write a programme in c++ to input marks of three subjects to calculate and print sum and average along with flow chart
Answers
Answered by
5
Solution:
The given códe is written in C++.
#include <iostream>
using namespace std;
int main() {
float num1,num2,num3,Sum,Average;
cout<<"Enter marks in first subject: ";
cin>>num1;
cout<<"Enter marks in second subject: ";
cin>>num2;
cout<<"Enter marks in third subject: ";
cin>>num3;
Sum=num1+num2+num3;
cout<<"Sum: "<<Sum<<endl;
Average=Sum/3.0;
cout<<"Average marks: "<<Average;
return 0;
}
For flowchart and output, refer to the attachment.
•••♪
Attachments:
Similar questions