Programming Fundamental Ass 5
Programming Fundamental Ass 5
by
ZOYA JABEEN(BS-CS)
int main()
{
student st1;
cout << " \n Student st1 " << endl;
cout << "Enter your Rollno:";
cin >> st1.rollno;
cout << "Roll no =" << st1.rollno << endl;
cout << "Enter your Name:";
cin >> st1.name;
cout << "Name =" << st1.name << endl;
cout << "Enter your fatherName:";
cin >> st1.fatherName;
cout << "FatherName =" << st1.fatherName << endl;
cout << "Enter your Marks:";
cin >> st1.marks;
cout << "Marks =" << st1.marks << endl;
student st2;
cout << "\n Student st2 " << endl;
cout << "Enter your Rollno:";
cin >> st2.rollno;
cout << "Roll no =" << st2.rollno << endl;
cout << "Enter your Name:";
cin >> st2.name;
cout << "Name =" << st2.name << endl;
cout << "Enter your fatherName:";
cin >> st2.fatherName;
cout << "FatherName =" << st2.fatherName << endl;
cout << "Enter your Marks:";
cin >> st2.marks;
cout << "Marks =" << st2.marks << endl;
student st3;
cout << " \n Student st3 " << endl;
cout << "Enter your Rollno:";
cin >> st3.rollno;
cout << "Roll no =" << st3.rollno << endl;
cout << "Enter your Name:";
cin >> st3.name;
cout << "Name =" << st3.name << endl;
cout << "Enter your fatherName:";
cin >> st3.fatherName;
cout << "FatherName =" << st3.fatherName << endl;
cout << "Enter your Marks:";
cin >> st3.marks;
cout << "Marks =" << st3.marks << endl;
return 0;
}
Output:
Student st1
Enter your Rollno:1
Roll no =1
Enter your Name:zoya
Name =zoya
Enter your fatherName:sagheer
FatherName =sagheer
Enter your Marks:567
Marks =567
Student st2
Enter your Rollno:2
Roll no =2
Enter your Name:asma
Name =asma
Enter your fatherName:akhtar
FatherName =akhtar
Enter your Marks:568
Marks =568
Student st3
Enter your Rollno:3
Roll no =3
Enter your Name:aleeza
Name =aleeza
Enter your fatherName:amjad
FatherName =amjad
Enter your Marks:569
Marks =569
void input() {
cout << "\nEnter Roll No: ";
cin >> rollno;
cout << "Enter Name: ";
cin >> name;
cout << "Enter Father's Name: ";
cin >> fatherName;
cout << "Enter Marks: ";
cin >> marks;
}
};
int main() {
const int numStudents = 3;
student st[numStudents];
Student 2:
Student 3: