Prepare
Practice
Interview
Aptitude
Reasoning
English
GD
Placement papers
HR
Current affairs
Engineering
MCA
MBA
Online test
Login
Online Practice Test
>
C
« Previous
Next »
Is the following code correct to create a structure?
struct s1{ ... };
Options
- yes
- no
CORRECT ANSWER : yes
Discussion Board
Explanation-
Syntax of defining structure:
struct structure_name
{
data_type member1;
data_type member2;
.
.
data_type memeber;
};
Sapna Tongase 03-8-2017 10:54 PM
Structure
Answer : yes.
Structure is the collection of variables of different types under a single name for better handling.
Example :
typedef struct complex
{
int imag;
float real;
}
comp;
Inside main:
comp c1,c2;
Jayesh Sonar 02-24-2015 02:36 AM
Ambiguous
What you mean by create is ambiguous. This is the declaration of a type, and the definition of a struct type.
Sam 06-21-2014 05:08 AM
Structure in C
Structure - collection of variables of different types under a single name.
- A structure is created with the help of keyword struct.
Aparna 07-5-2013 04:08 AM
« Previous
Next »
Write your comments
*
*
Email must be in the form someone@domain.com
*
*
Enter the code shown above:
Please enter the code shown above
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)
Related Content
C test (42)
C (12)
C++ for beginners (10)
C++ (20)
C++ (24)
C++ (18)
C++ (14)
C++ (12)
C++ (15)
C++ (15)
Data structure (20)
Data structure (10)
Data structure (10)
Data structure (10)
PERL (25)
VC++ (11)
Oops (30)
Mainframe (41)
Mainframe (15)
Embedded systems (15)
OOAD (49)
Advertisement
▲