💻
C - Structured Programming Language
  • C - Structured Programming Language
  • Structured Programming Language
    • Chapter 0: Overview
      • Overview of Programming
      • Overview of C Programming
      • History of C Programming
      • IDE - Code::Blocks
      • New File Creation and Managing Program Files in Folders
      • C Program Basic Structure
      • Sections of the C Program
      • Steps for Using a Program
      • Flow of a Program Execution
      • First C Program - Hello World
      • Comment
      • Lexical Elements (/Tokens)
      • Keywords
      • Character Set
    • Chapter 1: Data Type, IO
      • Data Type
      • Variable
        • Variable Declaration for Primitive Data Type
        • Variable Address and Input
        • Constant and Macro
        • Variable Scope and Lifetime
        • Variable Storage Type
        • Variable Declaration Vs Definition Vs Initialization
        • Variable Default Value
        • Identifier Naming Rules and Conventions
      • Primitive Data Type: Format Specifier and Size
      • Literals
      • Primitive Data Type: Input Output
        • Input Output Function
        • Integer IO
        • Real Number IO
        • Character IO
        • String IO
        • Formatted Output
        • Formatted Input
        • Return of Scanf and Printf
      • IO Error
      • Escape Sequence / Backslash Characters
      • Data Type Modifiers
        • Data Type Size and Format Specifier
        • Input Output Using Modifiers
      • Data Type Limit
        • Integer Number
        • Floating Point Number
      • Memory Segment
      • Type Casting
      • Declaration of Derived Data Type
        • Array
        • Pointer
        • Function
        • Structure
        • Union
      • Declaration of User Defined Data Type
        • Enumeration
          • Enum Constant Value
          • Enumeration Exercise
        • Typedef
      • Declaration of Other Data Type
        • Boolean
        • Complex and Imaginary Number
        • File
        • Clock and Time
    • Chapter 2: Operator
      • Types of Operators
      • Assignment Operator
      • Arithmetic Operators
        • Math Operation
      • Increment, Decrement Operators
      • Relational Operators
      • Logical Operators
      • Bitwise Operators
      • Miscellaneous Operators
      • Operator Precedence and Associativity
      • Programming Syntax & Expression
      • Operator Exercise
    • Chapter 3: Conditional Statement
      • Truth Value
      • If Else Exercise
        • Zero, Positive, Negative - Number Sign Test
        • Voting Eligibility
        • Complex Numbers Equality
        • Different Example
          • Print a Digit into Word
          • Grade Evaluation
          • FizzBuzz
          • EVEN or ODD
          • Leap Year
          • Maximum of 2 Numbers
          • Maximum of 3 Numbers
          • Minimum of 2 Numbers
          • Minimum of 3 Numbers
      • Ternary Operator
        • Ternary Operator Exercise
      • Switch Statement
        • Switch Statement Exercise
    • Chapter 4: Loop
      • Loop Basic
      • Series Printing using Loop
      • Summation and Factorial
      • Loop Exercise
      • Number Theory
      • Break and Continue
      • Nested Loop
      • Managing Test Case
      • Goto Statement
    • Chapter 5: Pointer and Dynamic Memory Allocation
      • Pointer Fundamental Concept
        • Pointer Declaration
        • Types of Pointer
        • Pointer for Primitive Data Types
        • Pointer Referencing, Initialization, Accessing, Dereferencing
        • Pointer Size
      • Pointer Operation
        • Value Assignment/Update
        • Pointer Input Output
        • Pointer and Operator
          • Assignment Operator
          • Arithmetic Operator
          • Increment/Decrement Operator
          • Relational Operator
        • Pointer and Flow Control
      • Multilevel Pointer
      • Dynamic Memory Allocation (DMA)
        • Dynamic Memory Allocation (DMA)
        • DMA for Primitive Data Types
        • Pointer Operation after DMA
    • Chapter 6: Function & Recursion
      • Type of Function
      • Function Exercise
      • Conditional Statement and Function
      • Loop Exercise using Function
      • Pointer and Function
      • Recursion
        • Example
        • Pointer
    • Chapter 7: Array
      • Array Fundamental Concept
        • Necessity
        • Declaration (1D Array)
        • Initialization
        • Access
        • Assignment
        • Address
        • User Input
          • Test Case
      • Function and Array
      • Basic Array Operation
        • Statistical Operations
          • Summation
          • Average (Mean), Median
          • Frequency Table, Mode
          • Standard Deviation, Variance
          • Covariance, Correlation
        • Searching
          • Linear Search
          • Binary Search
          • Maximum
          • Minimum
        • Update
          • Index Based
          • Element Based
        • Delete
          • Index Based
          • Element Based
        • Insert
          • Index Based
          • Element Based
        • Sorting
          • Selection Sort
          • Insertion Sort
          • Bubble Sort
      • Other Array Operation
        • Copy
        • Reverse
        • Compare
        • Merge
        • Split
        • Cyclic Permutation
      • Pointer and Array
        • Basic
        • Insert
        • Delete
        • Summation
        • Reverse
        • Compare
        • Merge
        • Split
        • Cyclic Permutation
      • Pointer and Array
      • DMA and Array
      • 2D Array
    • Chapter 8: Character and String
      • Character
        • Declaration and Initialization
        • ASCII Code
        • Input Output
        • Conditional Statement
        • Character Arithmetic
      • String
        • String Declaration and Initialization
        • Input Output
        • Character Count in String
        • Character Conversion in String
        • String Operations
          • Substring
      • String and Pointer
    • Chapter 9: Structure
      • Basic of Structure
      • Structure Pointer
      • Function and Structure
      • Nested Structure
      • DMA and Structure
    • Chapter 10: File
    • Miscellaneous
      • Working with Math Functions
      • Working with Time Functions
      • Union
      • Preprocessor
      • Custom Header File
      • Error Handling
      • Graphics
      • Other
      • Coding Convention
      • Identifiers (Variable, Function & Structure) Naming Convention
      • Sizeof
      • Exit, Abort
      • Assert
    • Reference
      • Online Learning Material
  • Exercise
    • Problem Set 0: IDE, First C Program - 4
    • Problem Set 1: Data Types, IO - 55
      • Data Type, Variable, Format Specifier, Input, Output, String - 33
      • Data Type, Input, Output - 8
      • Data Type, Data Type Modifier, Format Specifier, Size, Limit, Address - 9
      • Formatted Input-Output - 4
    • Problem Set 2: Operator - 108
      • 2.1 Assignment Operator - 11
      • 2.2 Arithmetic Operator - 73
        • 2.2.1 Arithmetic Operator [5]
        • 2.2.2 Arithmetic Operator Exercise [10]
        • 2.2.3 Scale Conversion [25]
        • 2.2.4 Geometrical Shapes [35]
      • Bitwise Operator - 11
      • Use of Library Functions - 23
    • Problem Set 3: Conditional Statements - 47
    • Problem Set 4: Loop - 124
      • Sequence and Series - 33
      • More Loop Exercise - 52
      • Test Case - 7
      • Loop Nested - 32
    • Problem Set 5: Pointer and Dynamic Memory Allocation
      • Pointer Exercise
    • Problem Set 6: Function and Recursion - 42
      • Recursion
    • Problem Set 7: Array
      • One Dimensional Array - 114
      • Two Dimensional Array
    • Problem Set 8: Character and String - 61
      • Character - 29
      • String - 32
    • Problem Set 9: Structure
    • Problem Set 10: File
  • Solution
    • 0: IDE, First C Program
    • 1: Data Types, IO
    • 2: Operator
      • 2.1 Assignment Operator
      • 2.2 Arithmetic Operator
    • 3: Conditional Statements
      • 3.1 Conditional Statement
      • 3.2 Relational Operator
      • 3.3 Logical Operator
      • 3.4 Max, Min Median, Sorting
      • 3.5 Divisibility
    • 4: Loop
      • 4.1.1 Loop (Repetition)
      • 4.1.2 Print Sequence
      • 4.1.3 Summation of Series
      • 4.2 Loop Exercise
    • 5: Pointer and Dynamic Memory Allocation
    • 6: Function and Recursion
      • 5.1 Types of User Defined Function
      • 5.2 Exercise - Function
    • 7: Array
    • 8: Character and String
      • 7.1 Character Basic
      • 7.2 Character Input
      • 7.3 ASCII Code
      • 7.4 Character Test
      • 7.5 Character Conversion
      • 7.6 Character Arithmetic Operation
    • 9: Structure
    • 10: File
Powered by GitBook
On this page
  • Problem Set 3.1: Conditional Statement [4]
  • Problem Set 3.2: Relational Operator [12]
  • Problem Set 3.3: Logical Operator [3]
  • Problem Set 3.4: Maximum, Minimum, Median, Sorting [9]
  • Problem Set 3.5: Divisibility [6]
  • Problem Set 3.6: Time and Date [6]
  • Problem Set 3.7: Geometrical Operation [7]
  1. Exercise

Problem Set 3: Conditional Statements - 47

Problem Set 3.1: Conditional Statement [4]

  1. Zero, Positive, Negative - Number Sign Test

    1. Determine whether an Integer Number is Zero or not. (Similar)

    2. Determine whether a Number is Positive, or Negative. (Similar)

    3. Determine whether a Number is Positive, Negative, or Zero.

  2. Test the Voting eligibility of a person based on their Age.

  3. Test the eligibility to apply for a job based on a person's Age. (Eligible Age 18-35)

  4. Test Equality of Two Complex Numbers.

Problem Set 3.2: Relational Operator [12]

  1. Testing Equality

    1. Test whether Two Numbers are Equal or Not.

    2. Print a Digit into a Word. [One for 1, Two for 2, etc.]

    3. Input 1-7 and print the Day of the Week. (Consider 1 for Sunday, 2 for Monday, etc.)

    4. Input 1-12 and print the Month of the Year. (Consider 1 for January, 2 for February, etc.)

    5. Test whether a Number is a Perfect Square or Not.

    6. Test whether a Number is a Perfect Cube or Not.

    7. Test whether a Number is a Power of Two or Not.

    8. Calculate the Power of a Number (Base^Exponent) [Consider both Base and Exponent as integer, and 0<=Exponent<=5] [No Built-in Function, Loop, or Recursion can be used, use only if, else]

  2. Comparison (Less Than/Greater Than)

    1. Determine Pass/Fail based on the Marks of an Exam. [Pass: 100-40, Fail: 39-00] [Consider only integer marks]

    2. Test the Voting eligibility of a person based on their Year of Birth.

    3. Calculate the Absolute Value of a Number.

    4. Determine Profit or Loss from Cost Price and Selling Price.

Problem Set 3.3: Logical Operator [3]

  1. Find the Grade of an Exam based on the Marks of an Exam. [Consider the Following Range for Grade: A+ (100-80), A (79-70), B (69-60), C (59-50), D (49-40), F (39-0)] [Consider only integer marks]

  2. Classify Temperature in Celsius into the following categories: Freezing, Cold, Mild, Warm, and Hot.

  3. Classify Body Mass Index (BMI) into the following categories: Underweight, Normal, Overweight, and Obese. (Calculate the BIM using weight and height as input)

Problem Set 3.4: Maximum, Minimum, Median, Sorting [9]

  1. Find the Maximum between Two Numbers.

  2. Find the Minimum between Two Numbers.

  3. Find the Maximum between Three Numbers.

  4. Find the Minimum between Three Numbers.

  5. Find the Middle Value among Three Numbers.

  6. Sort Three Numbers in Ascending Order.

  7. Sort Three Numbers in Descending Order.

  8. Find the Maximum of Four Numbers.

  9. Find the Minimum of Four Numbers.

Problem Set 3.5: Divisibility [6]

  1. Test whether an Integer Number is EVEN or ODD.

    1. Determine using the Modulus Operator.

    2. Determine using the Bitwise Operator.

    3. Try to Find more Alternative Solutions.

  2. Test whether an Integer Number is divisible by three (3) or not.

  3. Input an Integer Number, print Fizz if it is divisible by 3, print Buzz if it is divisible by 5, and print FizzBuzz if it is divisible by both 3 and 5.

  4. Test whether a Year is a Leap Year or Not.

  5. Test whether a Year is a Century Leap Year or Not.

  6. Test the Divisibility of a Number by Another Number.

Problem Set 3.6: Time and Date [6]

  1. Validate a Time. (Consider 24 Hours Format)

  2. Validate a Time. (Consider 12 Hours Format)

  3. Validate a Date. (Consider 12 Months, Each Month has 30 Days, and there is no Leap Year)

  4. Print the Total Number of Days in a Year. (Must consider Leap Year)

  5. Print the Total Number of Days in a Month. (Input Month as Number. (Consider 1 for January, 2 for February, etc.)) [No Need to Consider Leap Year]

  6. Input MM/YYYY and print the Total Number of Days in that Month of that Year. (Must consider Leap Year)

Problem Set 3.7: Geometrical Operation [7]

  1. Test whether a Triangle is Valid or Not based on the Lengths of Three Sides.

  2. Test whether a Triangle is Valid or Not based on the Three Angels.

  3. Classify a Triangle based on the Length of Three Sides into the following categories: Equilateral, Isosceles, and Scalene.

  4. Classify a Triangle based on a given Angle into the following categories: Acute-Angled, Right-Angled, and Obtuse-Angled Triangle.

  5. Determine the quadrant (I, II, III, or IV) of a Point (x, y) in a coordinate system.

  6. Test whether a Point (x, y) (coordinates) lies inside a circle with a given radius and center.

  7. Determine the roots of a quadratic equation. (Take Coefficients as Input [a, b, c, in ax2+bx+c=0ax² + bx + c = 0ax2+bx+c=0])

PreviousUse of Library Functions - 23NextProblem Set 4: Loop - 124

Last updated 8 months ago