0% found this document useful (0 votes)
4 views

Programming Languages for Mathematicians

The document contains objective and subjective question papers for the Programming Languages for Mathematicians course at GC University Lahore. The objective section includes multiple-choice questions, while the subjective section requires students to write programs and explain concepts related to programming. The exam is for BS (Hons.) students, with a total time of 20 minutes for the objective part and 160 minutes for the subjective part.

Uploaded by

drazharalizafar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Programming Languages for Mathematicians

The document contains objective and subjective question papers for the Programming Languages for Mathematicians course at GC University Lahore. The objective section includes multiple-choice questions, while the subjective section requires students to write programs and explain concepts related to programming. The exam is for BS (Hons.) students, with a total time of 20 minutes for the objective part and 160 minutes for the subjective part.

Uploaded by

drazharalizafar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

DEPARTMENT OF MATHEMATICS

GC UNIVERSITY LAHORE
OBJECTIVE QUESTION PAPER
PROGRAM: BS (Hons.)
EXAMINATION: FINAL 2022 SEMESTER:III
TITLE: PROGRAMMING LANGUAGES FOR MATHEMATICIANS
COURSE CODE:MATH-2102
TIME ALLOWED: 20 MINUTES MAX MARKS:10
ROLL. NO._____________________ NAME:______________________________

NOTE: Erasing/ Cutting and over writing shall bear NO MARKS

Question. No. 1. Encircle the alphabets of correct choice

1. Which of the following statement is correct about the class?


(a) An object is an instance of the class
(b) A class is an instance of its object
(c) An object is the instance of the data type of that class
(d) Both (a) and (c)
2. Which of the following is an object oriented language?
(a) C++
(b) COBOL
(c) MAPLE
(d) Both (a) and (b)
3. In C++ main() is a
(a) Compiler directive
(b) Function
(c) Comment
(d) Both (a) and (b)
4. Variables are created in
(a) RAM
(b) USB
(c) ROM
(d) None of these

5. The total number of elements in an array is called


(a) Index
(b) Size of an array
(c) Upper bound
(d) Both (a) and (b)
6. The set of rules for writing a program in any programming language is called
(a) Syntax
(b) Grammar
(c) Principle
(d) None of these
7. a-b>= x-y is an example of
(a) Compound assignment expression
(b) Relational expression
(c) Chained assignment expression
(d) Embedded assignment expression
8. In C++, which of the following has associativity of left to right?
(a) Address of
(b) Logical not
(c) Unary operator
(d) Array element access
9. In C++, it is possible that not to write the header file
(a) No, not at all
(b) Yes, it is possible
(c) May or may not
(d) None of these
10. Which of the following give the 3rd element of array?
(a) Array[2]
(b) Array[4]
(c) Array[3]
(d) None of these

DEPARTMENT OF MATHEMATICS
GC UNIVERSITY LAHORE
SUBJECTIVE QUESTION PAPER
PROGRAM: BS(Hons.)
EXAMINATION: FINAL 2022 SEMESTER:III
TITLE: PROGRAMMING LANGUAGES FOR MATHEMATICIANS
COURSE CODE:MATH-2102
TIME ALLOWED: 160 MINUTES MAX MARKS:40
NOTE: Attempt any FOUR Questions

Question. No. 2. (a) What is the purpose of default statement in switch statement, justify your
answer with example. 5

(b) What is the difference between high level and low level languages. 5

Question. 3. (a) Write a program that inputs a five digit number from the user and displays
it in reverse order. 6

(b) Write a program that inputs an integer and displays whether it is even or not. 4

Question. No. 4. (a) Write a program to displays the following Fibonacci numbers

1 1 2 3 5 8 13 21 34 55 89 6

(b) Write a program to find the area of parallelogram. 4

Question. No. 5. Write down a program to generate a result card of a student that includes
the detail of four subjects, the percentage of overall total and grade as you defined. 10

Question. No. 6. Write down a program that accept an integer from user and print the factorial
of the number. 10

You might also like