Professional Documents
Culture Documents
FA22-BSE-046 Mid-Term
FA22-BSE-046 Mid-Term
Registration No. :
FA22-BSE-046
Submitted By:
UNS YASEEN
Submitted To:
Sir Ahsan Maqsood
Subject:
Mid-term PF lab
Question No.01:
Answer:
#include <iostream>
int main() {
int rollNumber;
int factorial = 1;
int i = 1;
factorial *= i;
i++;
cout << "Factorial of " << rollNumber << " is: " << factorial << endl;
return 0;
}
Output:
Factorial of 46 is:
5502622159812088949850305428800254892961651752960000000000
Question No.02:
Answer:
#include <iostream>
int main() {
int grades[NUM_STUDENTS];
int sum = 0;
float average;
cout << "Enter the quiz grades for " << NUM_STUDENTS <<endl;
sum += grades[i];
return 0;}
Output:
Student 1: 91
Student 2: 76
Student 3: 88
Student 4: 60
Student 5: 72
Student 6: 85
Student 7: 74
Student 8: 90
Student 9: 63
Student 10: 70