-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuesNo1.cpp
More file actions
57 lines (39 loc) · 1.13 KB
/
QuesNo1.cpp
File metadata and controls
57 lines (39 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <iostream>
using namespace std;
// struct = User defined data type.Use for different items to combine..
struct Teacher
{
int teacherscale;
char Favsubject;
float salary;
};
struct Student
{
int totalstudents;
char section;
float totalsubjects;
};
int main()
{
Teacher teacher;
Student student;
cout << "What is teacher scale:" << endl;
cin >> teacher.teacherscale;
cout << "Enter teacher favsubject:" << endl;
cin >> teacher.Favsubject;
cout << "Enter teacher salary:" << endl;
cin >> teacher.salary;
cout << "Teacher scale is " << teacher.teacherscale << endl;
cout << "Teacher is " << teacher.Favsubject << endl;
cout << "Teacher is " << teacher.salary << endl;
cout << "Enter students total strength:" << endl;
cin >> student.totalstudents;
cout << "Enter students section :" << endl;
cin >> student.section;
cout << "Enter total subjects:" << endl;
cin >> student.totalsubjects;
cout << "Total students are " << student.totalstudents << endl;
cout << "Students section is " << student.section << endl;
cout << "students subject " << student.totalsubjects << endl;
return 0;
}