-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path8.1.cpp
More file actions
32 lines (31 loc) · 905 Bytes
/
8.1.cpp
File metadata and controls
32 lines (31 loc) · 905 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
27
28
29
30
31
32
/*Write a program that declares a structure to Roll_No, Marks,Average, and Grade of a student. The program should define a structure variable,
inputs the values and then displays these values.*/
#include<iostream>
using namespace std;
struct Student{
int rNO,marks;
float avg;
char grade;
};
int main(){
Student var;
void input(Student);
void display(Student);
input(var);
//display(var);
return 0;
}
void input(Student p){
cout<<endl<<"Enter Roll No. ";
cin>>p.rNO;
cout<<endl<<"Enter Marks :";
cin>>p.marks;
cout<<endl<<"Enter Grade :";
cin>>p.grade;
cout<<endl<<"Enter Average Marks :";
cin>>p.avg;
cout<<endl<<"Roll No :"<<p.rNO<<endl<<"Marks :"<<p.marks<<endl<<"Grade :"<<p.grade<<endl<<"Average :"<<p.avg;
}
/*void display(Student q){
cout<<endl<<"Roll No :"<<q.rNO<<endl<<"Marks :"<<q.marks<<endl<<"Grade :"<<q.grade<<endl<<"Average :"<<q.avg;
}*/