Attempt any Eight questions.
[8*5=40]
4.
How do you swap the values of two integers without using the third temporary variable? Justify with the example. [5]
5.
Write a program to find the sum of digits of a given integer using recursion. [5]
6.
Differentiate between constant and literals. Why do we need to define the type of data? [5]
7.
Write a program to find the second largest number in the given array of numbers. [5]
8.
Create a structure 'Employee' having Name, Address, Salary, and Age as member functions. Display the name of the employee having age between 40 and 50 and are living in Kathmandu. [5]
9.
List any one advantage and disadvantage of the pointer. How do you pass pointers as function arguments? [5]
10.
Suppose a file named 'Num.txt' contains a list of integers. Write a program to extract the prime numbers only from that file and write them on 'Prime.txt' file. [5]
11.
What is the advantage of the union over structure? List any four string library functions with the prototype. [5]
12.
Write short notes on: a. Local, Global, and Static variables b. Conditional Operator [5]