0% found this document useful (0 votes)
46 views1 page

Assignment2: CPP (Submission Date 22 October)

The document outlines 9 programming assignments that include writing code to: 1) Find and print all factors of a user-input integer. 2) Conditionally swap elements in an array. 3) Print and count integers between 1-100 not divisible by 2 or 3. 4) Explain rvalues and lvalues and their usage. 5) Explain different file opening modes. 6) Explain global and local variables with an example. 7) Interchange two arrays by reference. 8) Transpose a matrix. 9) Recursively calculate the running sum of the first 10 natural numbers.

Uploaded by

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

Assignment2: CPP (Submission Date 22 October)

The document outlines 9 programming assignments that include writing code to: 1) Find and print all factors of a user-input integer. 2) Conditionally swap elements in an array. 3) Print and count integers between 1-100 not divisible by 2 or 3. 4) Explain rvalues and lvalues and their usage. 5) Explain different file opening modes. 6) Explain global and local variables with an example. 7) Interchange two arrays by reference. 8) Transpose a matrix. 9) Recursively calculate the running sum of the first 10 natural numbers.

Uploaded by

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

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

You might also like