-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code in not running #4215
Comments
microsoft-github-policy-service
bot
added
the
Needs-Triage 🔍
It's a new issue that core contributor team needs to triage.
label
Oct 10, 2024
This issue was already fixed (see #1306). Please upgrade to the 2.3.5 version of PSReadLine from PowerShell Gallery. |
microsoft-github-policy-service
bot
removed
the
Needs-Triage 🔍
It's a new issue that core contributor team needs to triage.
label
Oct 10, 2024
please ensure that it does not repeat again......thanks |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
Exception report
Screenshot
Environment data
Steps to reproduce
#include
using namespace std;
class Student{
string name;
int rollNo;
float marks[5];
public:
void input();
void show();
void tot_marks();
};
void Student::input(){
cout << "Enter name: ";
getline(cin, name);
cout << "Enter roll number: ";
cin >> rollNo;
cout << "Enter marks (5 subjects): ";
for(int i=0; i<5; i++){
cout << "Subject " << (i+1) << ": "; // to display subject number
cin >> marks[i];
}
}
void Student::show(){
cout << "Name: " << name << endl;
cout << "Roll number: " << rollNo << endl;
cout << "Marks: "<<endl;
for(int i=0; i<5; i++){
cout << "Subject " <<(i+1) << ": " << marks[i] << endl;
// cout << marks[i] << " ";
}
cout << endl;
}
void Student::tot_marks(){
float total = 0;
for(int i=0; i<5; i++){
total += marks[i];
}
cout << "Total marks: " << total;
}
int main(){
Student s;
s.input();
s.show();
s.tot_marks();
return 0;
}
Expected behavior
Actual behavior
The text was updated successfully, but these errors were encountered: