Advertisement
alaminrifat

:) :)

Oct 28th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.05 KB | None | 0 0
  1. //  <> Lab Task <>
  2. #include<bits/stdc++.h>
  3. using namespace std;
  4. #define nl '\n'
  5.  
  6. int main(){
  7.     struct sinfo{
  8.         int id;
  9.         int ccredit;
  10.         float cgpa;
  11.     };
  12.  
  13.     int n = 10;
  14.     sinfo students[n];
  15.  
  16.  
  17.     for (int i = 0; i < n ; i++ ){
  18.         cout<<"Enter Student's id : "<<nl;
  19.         cin>>students[i].id;
  20.         cout<<"Enter Student's completed credit : "<<nl;
  21.         cin>>students[i].ccredit;
  22.         cout<<"Enter Student's CGPA : "<<nl;
  23.         cin>>students[i].cgpa;
  24.     }
  25.  
  26.     cout<<"Printing Student's ID with CGPA more than 3.75 "<<nl;
  27.     for (int i = 0; i < n ; i++ ){
  28.         if(students[i].cgpa >= 3.75){
  29.             cout<<"ID :: "<<students[i].id<<nl;
  30.         }
  31.         else{
  32.             continue;
  33.         }
  34.     }
  35.  
  36.     cout<<"Printing Student's ID who has completed more than 50 credits "<<nl;
  37.     for (int i = 0; i < n ; i++ ){
  38.         if(students[i].ccredit >= 50){
  39.             cout<<"ID :: "<<students[i].id<<nl;
  40.         }
  41.         else{
  42.             continue;
  43.         }
  44.     }
  45.  
  46.     return 0;
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement