Contents

Preface

1. Algorithms and Flowcharts

1.1 Algorithms

1.2 Flowcharts

1.3 Divide and Conquer Strategy

2. Basic Techniques

2.1 Sum of Two Given Numbers

2.2 Swapping the Contents of Two Variables

2.3 Simple Interest Calculation

2.4 Computing the Area of a Circle Given its Radius

2.5 Computing the Area of a Triangle Given all its Sides

2.6 Extracting the Unit's Digit of a Given Integer Number

Exercises

3. Decision Making

3.1 Largest of Two Given Numbers

3.2 Determining Whether a Given Integer Number is Positive or Negative

3.3 Determining Whether a Given Integer Number is Odd or Even

3.4 Largest of Given Three Numbers

3.5 To Find Out Whether a Given Year is a Leap Year or Not

3.6 Solving a Given Quadratic Equation

Exercises

4. Looping Techniques

4.1 Sum of First N Natural Numbers

4.2 Sum of the Squares of all Integers From 1 to N

4.3 Factorial of a Given Integer

4.4 Finding the Sum of Odd Numbers and Sum of Even Numbers from 1 to N

4.5 Generation of Required Number of Terms of the Fibonacci Sequence

4.6 Finding the GCD and LCM of Given Numbers

4.7 Sum of all the Digits of a Given Integer Number

4.8 Reversing a Number and to Check Whether it is a Palindrome or Not

4.9 To Find out Whether a Given Integer Number is Prime or Not

4.10 Prime Numbers Between 1 and N

4.11 Sum of First N Terms in the Expansion of Sine Series

4.12 Computing the Area of Circles Given Their Radii

Exercises

5. Multi-Way Decision Making

5.1 Solving Given Quadratic Equation Using Multi-way Decision Making Facility

5.2 Awarding Grades Based on Marks Scored in an Examination

5.3 A Simple Calculator

5.4 Selecting an Operation Based on a Menu

Exercises

6. Arrays

6.1 Reading in an Array and to Output the Same

6.2 Biggest Among Given ‘N’ Integer Numbers

6.3 The Maximum and Minimum Among Given N Integer Numbers

6.4 Average of a Given Set of N Numbers

6.5 Given N Integers (Zero, +Ve, -Ve) to Find Out the Sum of +Ve Numbers, -Ve Numbers and the Average of all Numbers

6.6 Mean, Variance and Standard Deviation of a Given Set of Numbers

6.7 Classification of the Elements of a Given Array into an Array Consisting of only Odd Elements and Another Array Consisting of only Even Elements

6.8 Sorting N Numbers in Ascending Order using Bubble Sort

6.9 Evaluating a Polynomial

6.10 Reading and Printing out a Given Matrix

6.11 To Compute the Sum/Difference of Given Matrices

6.12 Trace of a Given Matrix

6.13 Norm of a Given Matrix

6.14 Transpose of a Given Matrix

6.15 Product of Two Given Matrices

6.16 Searching a Given Element in a Given List of Integer Elements (Linear Search Algorithm)

6.17 Searching for a Given Element in an Array Using Binary Search Method

6.18 Sorting a Given Array of Elements Using Selection Sort

Exercises

7. Characters and String Handling

7.1 Finding the Length of A Given String

7.2 Determining Whether a Given String is Palindrome or Not

7.3 Reversing a Given String

7.4 Copying the Contents of a Given String into Another String

7.5 Concatenating Two Given Strings

7.6 Converting the Uppercase Alphabets into Lowercase Alphabets in a Given String and Vice - Versa

7.7 Counting the Number of Vowels and Consonants in a Given Line

7.8 Sorting a Given Set of Names

7.9 Counting the Number of Characters in an Input

7.10 Counting the Number of Words in a Given Line

7.11 Counting the Number of Lines in a Given Text

Exercises

8. Solving with Modules

8.1 Function to Print a Line Made up of Only Hash (#) Characters

8.2 Function to Multiply Two Given Integer Numbers

8.3 Function to Compute the GCD of Given Three Numbers

8.4 Function to Sum First N Terms of Sine Series Expansion and to Tabulate Sine Values for Different Angles

8.5 Functions to Compute Mean and Variance and Hence to Compute Standard Deviation of Given Set of Numbers

8.6 Functions to Read and Write one Dimensional Array

8.7 Function to Sort an Array Using Bubble Sort Method

8.8 Function to Search for a Required Element Using Binary Search Method

8.9 Functions to Sort a Given Unsorted Array Using Selection Sort

8.10 Functions to Read, Write and Compute Trace of Given Matrix

8.11 Functions to Compute Sum of Each Row, Sum of Each Column and Sum of All Elements of Given Matrix

8.12 Functions to Read, Write and Compute Product of Two Given Matrices

8.13 Program to Search for Required Element in a Given Unsorted Array Using Functions on Separate File

8.14 Understanding the Meaning of Local and Global Variables

8.15 Function to Swap Contents of Two Variables — The Wrong One

Exercises

9. Pointers

9.1 Understanding Prelims of Pointers

9.2 Understanding Pointer Expressions, Pointer-to-Pointer and Null Pointer

9.3 Finding Sum of all Elements of Array Using Pointers

9.4 Function to Swap Contents of Two Variables Using Pointers

9.5 Solving Quadratic Equation—Using Functions and Pointers

Exercises

10. Structures

10.1 Defining a Structure, Declaring, Structure Variables, Assigning Values to Structure Members and Printing Out Structure Member Values

10.2 Array of Structure Variables: Listing Names of Students Who Have Scored More Than 60% of Total Marks in Three Subjects Using Structure Variables

10.3 Sum of Two Complex Numbers-Passing Structure Variable To Function

10.4 Array of Structure Variables with a Structure as Member of Another Structure

Exercises

Index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.46.92