# Programming Fundamentals Past Papers – University

## 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:

Q.1. Write the output of the following segments of codes [6*3=18].

A.

```int b[4] = {11,1,2,3};
int* p = b;
*p = *(p+2);
cout << b[0];
```

B.

```int a[5];
a[4] = 3;
for (int i=3; i >= 0; i--)
{
a[i] = 2*a[i+1] - i;
cout <<"\n"<< a[i];
}
```

C.

```for (int i=1; i<4; i++)
{
for (int j=1; j<=i; j++)
cout << j << " ";
cout << "\n";
}
```

D.

```int main( )
{
increment( ) ;
increment( ) ;
increment( ) ;
}
void  increment( )
{
static int i = 1 ;
cout<< i  ;
i = i + 1 ;
}
```

E.

```int x=2;
int y=3;
cout <<(x>y?x:y);
```

F.

```int x = 7;
int y = 3;
cout << x/y << " , " << x%y<<"and"<<++x*y--;
```
1. 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]
```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*);```

Q.3.(10 points) We know that when an array is defined a constant pointer is created which stores the starting address of an array.  For example

float arr[6]={10,20,30,40,50,60};

a constant pointer,  with the name of ‘arr’, is created as given below:[7]

### 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:

Instruction:

1. All questions are compulsory.

Q#1

What is pointer variable? Explain the working of pointer variable?                                    (10)

Q#2

Write a program that declares a STRUCTURE to store roll nos. and marks of 5 subjects in a single array. The program should define a structure variable, inputs the values and displays roll no, marks and average marks?                                                                                            (10)

Q#3

Write a program to initialize 3 different strings and perform the following functions:

1. Copy STRING1 into STRING3 (5)
2. Concatenate STRING1 and STRING2 (5)
3. Calculate and show the total length of STRING1 after concatenation. (5)

Q#4

1. Differentiate between actual and formal parameter?                                     (5)
2. 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)

Q#5     Write a program to initialize the array with 5 values and the sort the values with

selection sort?                                                                                                            (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:

Q1:                                                                                                                              (10)

Write a program to bubble sort the values in an array?

Q2:                                                                                                                              (10)

Write a program to calculate the sum of the following series using do while loop.

1+1/2+1/4+1/6+1/8+…………………..+1/100

Instructions: Use the user define functions.

Q3:                                                                                                                              (5)

Write a program to display the following output.

100                  10                    120

80                    30                    150

60                    50                    180

Instructions:

Use the user define functions.

Use the struct

Q4:                                                                                                                              (5)

Write a program that takes inputs from the user within a described range, and then adds only the odd numbers within the array.

Instructions:

Use the Global Variable

Use  For loop

Use user define a function

Q5:                                                                                                                              (5)

Write a program that takes the built-in functions of string to concatenate, and copies the strings.

### 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:

Q1:                                                                                                                                          (10)

Write a program to generaFibonaccibonacci numbers in an array within the given range, and then add all the indexes within the array, and show the final sum.

Q2:                                                                                                                                          (10)

Demonstration of practical/project performed in computer Lab.

### 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:

Q#1     Write a program that takes two numbers from the user as an input, and then demonstrates the working of a calculator using a switch statement?                7 Marks

Hint: Calculator working is like addition, multiplication, subtraction of two numbers

Q#2     Write a program to swap two variables without using a third variable?      7 Marks

Q#3     Write a program to find the factorial of a number using while loop?          7 Marks

Q#4     Write a program that displays the following shape using nested for loop?

*

*  *

*  *   *                                                                                                                       7 Marks

Q#5                                                                                                                 3+3+2=8 Marks

1. 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.

Do{Cout<<”enter a number”<<Endl;

}While(number < 10)

1. Write two different techniques to declare and initialize a variable with an example?
2. 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:

Q#1     Write a program that takes a number from the user and then shows that number is even or odd?                                                                                                                                                                                 7 Marks

Q#2     Write a program (starting from #include) that repeatedly collects positive integers from the user, stopping when the user enters a negative number or zero. After that, output the product of all positive entries.                                                                                                                                                                                              6 Marks

Q#3     Write a program to find the factorial of a number using for loop?                                      7 Marks

Q#4     Write a program that takes the maximum range for calculating the Fibonacci and then to calculate the Fibonacci series of numbers.

Hint : Fibonacci series is like 1,1,2,3,5,8,13,21,…….till range            .

e.g, if a user enters a range of 5 then first five should be calculated only,

like 1,1,2,3,5,8 11                                                                                                                            7 Marks

Q#5                                                                                                                                        5+3=8 Marks

1. Write the minimum five rules for naming a variable?
2. 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:

Instruction:

1. All questions are compulsory.

Q#1

Write a program that initializes ten values within an array and sort the array

with bubble sort?                                                                                                                    (10)

Q#2

Write a program that gets the values in two-dimensional array, and after getting the values, the program should show the values.                                                                                                                             (10)

## Electrical Engineering Past Papers and Guess(EE)

1. Calculus & analytic geometry past papers
2. Introduction to computing past papers
3. Electricity and magnetism past papers
4. APPLIED LINEAR ALGEBRA past papers
5. Programming Fundamentals Past Papers
6. Electronic devices and circuits
7. Digital Logic Design DLD Past Papers
8. Basic Electronics & DLD Past Papers
9. Functional English Past Papers
10. Differential Equations Past Papers
11. Data Structures Past Papers
12. Electric Machines Past Papers
13. Network Analysis Past Papers
14. Numerical Analysis Past Papers
15. Signals Systems Past Papers
16. complex variables and transform past papers
17. Engineering drawing and AutoCAD past papers
18. Applied Thermodynamics Past Papers
19. Communication and presentation skills Past Papers
20. Field Theory Past Papers
21. Communication Systems Past Papers
22. Embedded Systems Past Papers
23. Basic Electronics Instrumentation Past Papers
24. Power Transmission Distribution Past Papers
25. Linear control systems Past Papers
26. Probability Methods in Engineering Past Papers
27. Engineering Economics Past Papers
28. Technical Report Writing Past Papers
29. Professional Ethics Past Papers