Subject : Fundamentals Of Programming Language Subject Code: ECS-105-COM
Unit-IV : Arrays
Q. 1. Define what a one-dimensional array is in C. Provide an example of its declaration
syntax. Q. 2. Explain how one-dimensional arrays are initialized in C. Give examples demonstrating different initialization methods, including explicit and partial initialization. Q. 3. What are two-dimensional arrays in C? How are they different from one-dimensional arrays ? Provide an example of a two-dimensional array declaration. Q. 4. Explain what character arrays are in C. How are they used to store string ? Provide an examples of declaring and initializing character arrays to store string of different lengths. Q. 5. Describe how string can be read from the terminal (input) in C. Provide an example demonstrating the use of functions like scanf and fgets for reading strings. Q. 6. Discuss the process of writing string to the screen (output) in C. Provide an examples showing the use of printf and puts functions for displaying strings. Q. 7. Explain how strings can be Concatenated or “put together” in C. Provide an examples illustrating different methods for concatenating strings, such as using library functions or manually appending characters. Q. 8. Compare two strings in C using built in functions. Discuss the significance of string comparison and provide examples of using functions like strcmp for comparing strings. Q. 9. Introduce some fundamental string handling functions in C. Provide examples and explanations of function such as strln, strcpy, strtok in manipulating strings.