C Program To Add Two Complex Numbers By Passing Structure With Function Using Structure In C
What Is Structure
The structure is a user-defined data type in C which allows you to combine different data types to store a particular type of record. The structure is used to represent a record. Suppose you want to store a record of Student which consists of student name, address, roll number and age. You can define a structure to hold this information.
Defining a structure
struct keyword is used to define a structure. struct define a new data type which is a collection of different type of data.
Syntax :
struct structure_name
{
//Statements
};
Output:
For 1st complex number
Enter real and imaginary respectively:
3.5
6.5
For 2nd complex number
Enter real and imaginary respectively:
45.2
69.96
Sum=48.7+76.5i
need an explanation for this answer? contact us directly to get an explanation for this answer