-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8.11.cpp
More file actions
26 lines (25 loc) · 737 Bytes
/
8.11.cpp
File metadata and controls
26 lines (25 loc) · 737 Bytes
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
//Nested Structure.
/*Write a program that uses two structures Result and Record. The Result structure stores marks and grade , and Record structure
stores rollNo and Result type. The program declares a variable of type Record,inputs rollNo,marks and grade. It finally displays the values.*/
#include<iostream>
using namespace std;
struct Result{
int marks;
char grade;
};
struct Record{
int rollNo;
Result t;
}var;
int main(){
cout<<endl<<"Enter Roll_No :";
cin>>var.rollNo;
cout<<endl<<"Enter Marks :";
cin>>var.t.marks;
cout<<endl<<"Enter Grade :";
cin>>var.t.grade;
cout<<endl<<"\tRoll No :"<<var.rollNo;
cout<<endl<<"\tMarks :"<<var.t.marks;
cout<<endl<<"\tGrade :"<<var.t.grade;
return 0;
}