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

OCS 752 Assignment II

The document discusses questions about C programming concepts including header files, arrays, multi-dimensional arrays, searching and sorting arrays, and programs to insert elements into arrays and fill a matrix with values.
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)
22 views1 page

OCS 752 Assignment II

The document discusses questions about C programming concepts including header files, arrays, multi-dimensional arrays, searching and sorting arrays, and programs to insert elements into arrays and fill a matrix with values.
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

OCS752 INTRODUCTION TO C PROGRAMMING

Assignment Questions II

Part A
1. What are header files? Why they are important?
2. Why do we include <stdio.h> in our programs?
3. What are arrays and why are they needed?
4. How is an array represented in the memory?
5. Write an example code to declare a two dimensional array.
6. What is the use of multi-dimensional arrays?
7. Given an array int marks[] = {99,67,78,56,88,90,34,85}, calculate the address of
marks[4] if the base address = 1000.
8. Differentiate linear search and binary search methods that are used with arrays.
9. Write a C program to exchange two elements of an array.
10. What are the various sorting concepts used in arrays?

Part B

11. Write a C program to insert an element in an array.


12. Write a C program using arrays to fill the diagonal elements of a matrix with 0, lower
triangle with -1 and upper triangle with 1.
13. Write a C program to search an element in a given array using binary search method.

You might also like