-
Notifications
You must be signed in to change notification settings - Fork 0
/
cgpa stdnt.cpp
46 lines (39 loc) · 1.02 KB
/
cgpa stdnt.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>
using namespace std;
#define nl '\n'
int main(){
struct sinfo{
int id;
int ccredit;
float cgpa;
};
int n = 10;
sinfo students[n];
for (int i = 0; i < n ; i++ ){
cout<<"Enter Student's id : "<<nl;
cin>>students[i].id;
cout<<"Enter Student's completed credit : "<<nl;
cin>>students[i].ccredit;
cout<<"Enter Student's CGPA : "<<nl;
cin>>students[i].cgpa;
}
cout<<"Printing Student's ID with CGPA more than 3.75 "<<nl;
for (int i = 0; i < n ; i++ ){
if(students[i].cgpa >= 3.75){
cout<<"ID :: "<<students[i].id<<nl;
}
else{
continue;
}
}
cout<<"Printing Student's ID who has completed more than 50 credits "<<nl;
for (int i = 0; i < n ; i++ ){
if(students[i].ccredit >= 50){
cout<<"ID :: "<<students[i].id<<nl;
}
else{
continue;
}
}
return 0;
}