forked from thakursaurabh1998/cpp
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ques21.cpp
46 lines (46 loc) · 1.08 KB
/
ques21.cpp
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
#include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
int main()
{
char ch='y';
int num;
int var;
cout<<"Enter Number Of Students : ";
cin>>num;
int* student=new int[num-1];
int* marks=new int[num-1];
int* attendance=new int[num-1];
for(int i=0;i<num;i++)
{
marks[i]=0;
attendance[i]=0;
}
for(int i=0;i<num;i++)
{
cout<<"Enter Marks Of "<<i+1<<" Student : ";
cin>>marks[i];
cout<<"Enter Attendance Of "<<i+1<<" Student : ";
cin>>attendance[i];
}
while (ch=='y'||ch=='Y')
{
cout<<"Choose One : ";
cout<<"\n1. Check Marks/Attendance\n2. Exit \n";
cout<<"Your Choice : ";
cin>>var;
if(var==1)
{
int roll;
cout<<"Enter Roll Number : ";
cin>>roll;
cout<<"Marks : "<<marks[roll-1]<<"\n";
cout<<"Attendance : "<<attendance[roll-1];
}
if(var==2)
exit(0);
cout<<"\nDo You Wish To Continue? (Y or N) : ";
cin>>ch;
}
}