Answer to Question #48815 in 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
1
Expert's answer
2014-11-13T02:49:11-0500
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;
system("pause");
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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS