Programming Fundamentals Past Papers – University
Here, we are showing you a sample of past paper of programming fundamental. If your student of a university and want to get an idea of the paper. Then this is a great sample paper for you.Programming Fundamentals – Paper 1
Course Code: Confidential | Course Title: Programming Fundamentals |
Teacher’s Name: Confidential | Total Marks: 60 (points) |
Date & Time: Confidential | Total Time: 2 Hours |
Student’s Name: | Reg. No: |
1 2 3 4 |
int b[4] = {11,1,2,3}; int* p = b; *p = *(p+2); cout << b[0]; |
1 2 3 4 5 6 7 |
int a[5]; a[4] = 3; for (int i=3; i >= 0; i--) { a[i] = 2*a[i+1] - i; cout <<"\n"<< a[i]; } |
1 2 3 4 5 6 |
for (int i=1; i<4; i++) { for (int j=1; j<=i; j++) cout << j << " "; cout << "\n"; } |
1 2 3 4 5 6 7 8 9 10 11 12 |
int main( ) { increment( ) ; increment( ) ; increment( ) ; } void increment( ) { static int i = 1 ; cout<< i ; i = i + 1 ; } |
1 2 3 |
int x=2; int y=3; cout <<(x>y?x:y); |
1 2 3 |
int x = 7; int y = 3; cout << x/y << " , " << x%y<<"and"<<++x*y--; |
- 2. Briefly comment each of the following lines of code. The first line is done for you. Make sure you describe the difference between statements. [7]
1 2 3 4 5 6 7 8 |
int x = 2; //Creates integer variable named x and assigns it value 2. int *p; p = &x; *p = 4; cout << p;. cout << *p; int fun(int *, int*); |

arr+3 and *(arr+3)
If the type of the above-mentioned array is an integer instead of float then calculate arr+3 and *(arr+3)
Q.4. Write a function to print the following series where n is input by the user in the main function. The limit should be inputted through the keyboard and will be passed to function as an argument.[7]
1 + 1/2 + 1/3 + 1/4 + 1/5 +…………1/n
Q.5. Write a recursive function to obtain the running sum of the first 100 natural numbers.[7]
Q.6. Create a structure named Student to specify data on students given below: [7]
Roll number, Name, Department, Course, Year of joining
Assume that there are not more than 450 students in the college.
(a) Write a function to print names of all students who joined in a particular year.
(b) Write a function to print the data of a student whose roll number is given.
Q.7. Differentiate the following:[2×4=8]
a) Actual Parameters and Formal Parameters
b) Parameter passing by value and by the pointer
Programming Fundamentals – Paper 2
Course Code: Confidential | Course Title: Programming Fundamentals |
Teacher’s Name: Confidential | Total Marks: 60 (points) |
Date & Time: Confidential | Total Time: 2 Hours |
Student’s Name: | Reg. No: |
- All questions are compulsory.
- Copy STRING1 into STRING3 (5)
- Concatenate STRING1 and STRING2 (5)
- Calculate and show the total length of STRING1 after concatenation. (5)
- Differentiate between actual and formal parameter? (5)
- Write a program that displays back-counting from 10 to 1 by incorporating the(do while loop, function calls, function declaration, function definition, and global variable) concepts in your program. (10)
Program | %age of LB covered prior Mid-Term | %age of LB expected to be covered prior Final-Term | Question Paper Weight Prior Mid + After Mid | %age of Objective Questions |
MCS-1A | 50% | 50% | After Mid 100% | Nill |
Programming Fundamentals – Paper 3
Course Code: Confidential | Course Title: Programming Fundamentals |
Teacher’s Name: Confidential | Total Marks: 35 (points) |
Date & Time: Confidential | Total Time: 2 Hours |
Student’s Name: | Reg. No: |
Programming Fundamentals – Paper 4 Practical
Course Code: Confidential | Course Title: Programming Fundamentals |
Teacher’s Name: Confidential | Total Marks: 20 (points) |
Date & Time: Confidential | Total Time: 30 Minutes |
Student’s Name: | Reg. No: |
Programming Fundamentals – Paper 5
Course Code: Confidential | Course Title: Programming Fundamentals |
Teacher’s Name: Confidential | Total Marks: 35 (points) |
Date & Time: Confidential | Total Time: 2 Hours |
Student’s Name: | Reg. No: |
- Makes an observation to detect that this code is error free or not? If you find errors, then explain what the errors in this code are.
- Write two different techniques to declare and initialize a variable with an example?
- What is the difference between while and do while loop?
Programming Fundamentals – Paper 6
Course Code: Confidential | Course Title: Programming Fundamentals |
Teacher’s Name: Confidential | Total Marks: 35 (points) |
Date & Time: Confidential | Total Time: 2 Hours |
Student’s Name: | Reg. No: |
- Write the minimum five rules for naming a variable?
- Write two different techniques to declare and initialize a variable with an example?
Programming Fundamentals – Paper 7 -Practical
Course Code: Confidential | Course Title: Programming Fundamentals |
Teacher’s Name: Confidential | Total Marks: 20 (points) |
Date & Time: Confidential | Total Time: 2 Hours |
Student’s Name: | Reg. No: |
- All questions are compulsory.
[OBJECTIVE] Subject: Programming Fundamentals Time Allowed: 15 Minutes Max Marks: 10 NOTE: Attempt this Paper on this Question Sheet only. Please encircle the correct option. Division of marks is given in front of each question. This Paper will be collected back after expiry of time limit mentioned above. Part-I Encircle the Correct Answer, cutting and overwriting are not allowed. (10)
- Placing function prototypes in the definitions of other functions restricts function calls to the function in which the prototypes appear.
- Pointers are valid operands in arithmetic expressions, assignment expressions, and comparison expressions. However, not all the operators normally used in these expressions are valid in conjunction with pointer variables.
- A pointer to void can be dereferenced just like any other pointer, by using the indirection operator (*).
- If b is the name of an array of at least 4 elements, then the following statements both refer to its 4th element.
- The following statement defines an array of pointers to strings.
- The following function receives a const double-scripted array of integers and two const string arrays.
- A function name is really the starting address in memory of the code that performs the function’s task. Pointers to functions can be passed to functions, returned from functions, stored in arrays, and assigned to other function pointers.
- The following statement defines a pointer to a function that receives two integer parameters and returns an integer result. int *compare( int, int );
- In C, all arrays passed to functions are passed by reference.
- 10. The string “life “, may be stored in an array of 4 characters.
- The name of the text file that contains single ~ digit integer data separated by a white space.
- An integer to be searched from the data in the file.
- Is said to be short if it contains less than 6 characters.
- Is perfect if it its length is greater than 6. (Max. length is 20 characters.)
