Assignment2: CPP (submission date 22 October)
1. Write a program that asks user for integer value and then prints out all its factors.
2. One dimensional array A[j] has N elements. Write a program segment which
a. Interchanges A[1] and A[2], only if A[1]>A[2], interchanges A[3] and
A[4] only if A[3] > A[4] and so on
b. Cyclically permutes the values of A so that A[2] contains the original
value of A[1], A[3] contains original value of A[2] and so on with A[1]
3. Write a program to print all integers that are not divisible by 2 and 3 and lie
between 1 and 100. program should also count the number of such integers and
print the same
4. Explain the concept of rvalue and lvalue . what the rules should be followed while
using them with assignment operator.
5. Explain in detail different modes of opening the file
6. Explain the concept of global and local variable in detail with example
7. Write a program to interchange the values of two arrays by reference.
8. Write a program to perform transpose of matrix.
9. Write a recursive function to obtain running sum of first 10 natural numbers