Programming for Problem Solving
  1. Introduction to Components of a Computer System
  2. Introduction to Components of a Computer System
  3. Computing Environments
  4. Computing Environments
  5. Computer Languages
  6. Computer Languages
  7. Creating and Compiling and Executing a Program
  8. Creating and Compiling and Executing a Program
  9. Program Development
  10. Program Development
  11. Number Systems-Binary,Decimal,Hexadecimal and Conversions
  12. Number Systems-Binary,Decimal,Hexadecimal and Conversions
  13. Introduction to Algorithms
  14. Introduction to Algorithms
  15. Representation of Algorithm, Flowchart/Pseudo code with examples
  16. Representation of Algorithm, Flowchart/Pseudo code with examples
  17. Program Design & Structured Programming
  18. Program Design & Structured Programming
  19. Introduction to C Programming :Identifiers
  20. Introduction to C Programming :Identifiers
  21. Introduction to C Programming Language: Variables
  22. Introduction to C Programming Language: Variables
  23. Constants
  24. Constants
  25. Data Types
  26. Data Types
  27. Syntax and Logical Errors in compilation
  28. Syntax and Logical Errors in compilation
  29. Object and Executable code
  30. Object and Executable code
  31. Operators
  32. Operators
  33. Expressions and Precedence
  34. Expressions and Precedence
  35. Precedence and Associativity
  36. Precedence and Associativity
  37. Expression Evaluation
  38. Expression Evaluation
  39. Storage Classes - Auto, Register
  40. Storage Classes - Auto, Register
  41. Storage Classes - Static, Extern
  42. Storage Classes - Static, Extern
  43. Type Conversions
  44. Type Conversions
  45. The Main Method and Command Line arguments
  46. The Main Method and Command Line Arguments
  47. Bitwise AND,OR, XOR, and NOT Operators
  48. Bitwise AND,OR, XOR, and NOT Operators
  49. Conditional Branching
  50. Conditional Branching
  51. Loops
  52. Loops
  53. Other Statements Related to Looping
  54. Other Statements Related to Looping
  55. Input and Output with scanf and printf
  56. Input and Output with scanf and printf
  57. Preprocessor Commands
  58. Preprocessor Commands
  59. Unit - 1 Short Answers Questions
  60. Unit -1 Long Answer Questions
  61. Unit - 1 Problem Solving And Critical Thinking Questions
  1. Arrays - Concepts, Using Arrays in C
  2. Arrays - Concepts, Using Arrays in C
  3. Arrays
  4. Arrays
  5. Two - Dimensional Arrays
  6. Two - Dimensional Arrays
  7. Multidimensional Arrays
  8. Multidimensional Arrays
  9. Strings - Concepts, C Strings
  10. Strings - Concepts, C Strings
  11. Strings - String Input Output functions
  12. Strings - String Input Output functions
  13. String - String Manipulation Functions
  14. String - String Manipulation Functions
  15. String - String Data Conversion
  16. String - String Data Conversion
  17. Strings - Arrays of Strings
  18. Strings - Arrays of Strings
  19. Structures and Unions
  20. Structures and Unions
  21. The Type Definition (typedef)
  22. The Type Definition (typedef)
  23. Declaration and Initialization of Structures
  24. Declaration and Initialization of Structures
  25. Operations on Structures
  26. Operations on Structures
  27. Complex Structures-Nested Structures
  28. Complex Structures-Nested Structures
  29. Complex Structures- Structures Containing Arrays
  30. Complex Structures- Structures Containing Arrays
  31. Complex Structures- Structures and Functions
  32. Complex Structures- Structures and Functions
  33. Complex Structures- Arrays of Structures
  34. Complex Structures- Arrays of Structures
  35. Complex Structures- Passing Structures Through Pointers
  36. Complex Structures- Passing Structures Through Pointers
  37. Unions
  38. Unions
  39. Pointers – Introduction
  40. Pointers – Introduction
  41. Pointers to Pointers, Compatibility
  42. Pointers to Pointers, Compatibility
  43. Pointer Applications-Arrays and Pointers
  44. Pointer Applications-Arrays and Pointers
  45. Pointer Arithmetic and Arrays
  46. Pointer Arithmetic and Arrays
  47. Passing an Array to a Function, Memory Allocation Functions
  48. Passing an Array to a Function, Memory Allocation Functions
  49. Array of Pointers - Programming Applications
  50. Array of Pointers - Programming Applications
  51. Pointers to Void
  52. Pointers to Void
  53. Pointers to Functions
  54. Pointers to Functions
  55. Unit - II Short Answers Questions
  56. Unit - II Long Answer Questions
  57. Unit - II Problem Solving And Critical Thinking Questions

Arrays - Concepts, Using Arrays in C

Arrays

  • Array: An array is a group of related data items that share a common name.

(or) Homogenous collection of data items that share a common name.

  • A particular value in an array is identified using its “index number” or “subscript”.

Advantage

  • The ability to use a single name to represent a collection of items and to refer to an item by specifying the item number enables the user to develop concise and efficient programs.

Declaring for declaration of an array :

Syntax : for declaring array:

Example:

  1. float height [50]

This declare the ‘height’ to be an  array containing 50 float elements

  1. int group (10)
  • This declares the ‘group’ as an array to contain a maximum of 10- integer constants
  • Individual elements are identified using “ array subscripts”
  • While complete set of values are referred to as an array, individual values are called “elements”

Example:

  • To represent a set of 5 numbers by an array, it can be declared as follows

int a[5];

  • Then computer reserves 5 storage locations each of 2 bytes.

  • First element is identified by subscript ‘zero’ i.e., a[0] represents first element of the array.
  • If there are ‘n’ elements in array then subscripts range from 0 to n-1

Initialization

To store values into an array it can be done as follows.

An array can also be initialized at the time of declaration as follows

int a[5] =   {  10,20,30,40,50};

Types of Arrays

Arrays are broadly classified into 3 types. They are

  1. One – dimensional arrays
  2. Two – dimensional arrays
  3. Multi – dimensional arrays