0% found this document useful (0 votes)
9 views

Assignment 5

c programming

Uploaded by

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

Assignment 5

c programming

Uploaded by

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

Programming & DS Lab (Course Code: CS112)

Practice Assignment - 5

Submission Deadline: 13/05/2022 Midnight

-------------------------------------------------------------------------------------------------------
Instructions:
 Proper indentation is mandatory.
 You should comment the statements whenever necessary, to make the code
understandable.
 Answers files: 5_1.c, 5_2.c, 5_3.c, 5_4.c, 5_5.c, 5_6.c

Q1. Suppose we divide a one-dimensional array of integers of length 2n (where n is only) into two
equal parts and then fold each part at its middle position. Swap the elements that overlap with each
other in those respective parts.

e.g.

Example_1: int arr[ ]={1, 2, 3, 4, 5 , 6,7,8} //even length array

Q2. Write a function Power() to raise a number m to a power n, where m and n are integers. Write a
main that gets the values of m and n from the user and then calls Power() by passing m and n values
as parameters.

Q3. Write a program that reads a floating point number and then displays the right-most digit of the
integral part of the number. For example, if 123.45 is the input, then 3 should be the output.

Q4. Write a program to store 10 numbers in 1-D array and then sort the array in ascending order.
After sorting display the sorted list.

Q5. Write a program to store 9 numbers in 3 by 3 matrix then transpose the matrix.

Q6. Write a program to check if a number is palindrome.

You might also like