Getting Started With C

Structures:- A structure is a user-defined data type that allows you to group together different data types under a single name.
Functions:- Functions in C are blocks of code that perform a specific task. They allow you to break down your program into smaller, manageable pieces.

Declaring structure as function argument:
            Return_type  function_name(struct structure_name struct_var_name);
            
  • Examples :

    Program.c


  • Output:

            Rectangle Area: 15.00
    
        
        

    Resources :

    Test Your Knowledge
    Choose The

    With supporting text below as a natural lead-in to additional content.

    Q1. How do you pass a structure to a function in C?

    Q2. What is the primary advantage of passing a structure to a function by reference (using a pointer) in C?