76 805
Assignments Done
Successfully Done
In June 2019

Answer to Question #48815 in Other Engineering for Fayaz Rehman

Question #48815
write a c program to input name and marks in 3 subjects of student display the total marks of the student
Using Structure
Expert's answer
Answer on Question #48815, Engineering, Other
#include <iostream>
#include <string>
#include <cstdlib>

using namespace std;

struct Student
string name;
int mark1;
int mark2;
int mark3;

int main()
Student st;
cout <<"enter student's name: ";
cin >> st.name;
cout <<"enter student's first mark: ";
cin >> st.mark1;
cout <<"enter student's second mark: ";
cin >> st.mark2;
cout <<"enter student's third mark: ";
cin >> st.mark3;
cout <<"Summary " << endl;
cout <<"Student name: " << st.name << endl;
cout <<"Student's first mark: " << st.mark1 << endl;
cout <<"Student's second mark: " << st.mark1 << endl;
cout <<"Student's third mark: " << st.mark1 << endl;
return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions