Become a GOLD member of Deccansoft and get access to 40+ courses!!
NewBatches/Webinars
Packages
Gold Membership
Bestseller
Microsoft Azure Suite & Suite Plus
Power Platform Acadamy
New
Azure DevOps Expert & Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Courses
MS.NET Courses (Includes Live Project)
Complete C#, OOPs and Windows Programing
ASP.NET MVC Online Training
ASP.NET WebForms
ASP.NET Core
WCF incl. Web Services and Remoting
WPF incl. MVVM and Prism
LINQ and Entity Framework
Live Project Training for Developing Enterprise Application
Live Project using Ntier Arch (.NET5 + EF Core + Angular)
Microservices using .NET Core
Gold Membership
CareerStep IT Program
Client-side UI Technologies
Building Static Web Pages using HTML and CSS
JavaScript and HTML DOM
jQuery, AJAX and JSON
Building Interactive Web Pages using HTML5 and CSS3
BootStrap + Live Examples
AngularJS + Live Project
Angular + Typescript
ReactJS
KnockoutJS
Xamarin
SQL Server + MSBI
SQL Server 2017
Querying Data with Transact-SQL(70-761)
SQL Server Integration Service (SSIS)
SQL Server Reporting Service (SSRS)
SQL Service Analysis Service (SSAS)
Cloud Computing / Azure / AWS
AZ-900: Microsoft Azure Fundamentals
Azure Suite (AZ-104+AZ-204+AZ-305+ AZ-500)
AZ-104: Microsoft Azure Administrator
AZ-204: Developing Solutions for Microsoft Azure
AZ-305: Microsoft Azure Architect Technologies and Design
DP-203: Data Engineering on Microsoft Azure
Amazon Web Services (AWS)
DevOps Expert
AZ-400: Microsoft Azure DevOps
Docker by Sandeep Soni
Kubernetes by Sandeep Soni
Docker & Kubernetes by Rahul Rampurkar
IaC Using Terraform
Powershell
Microsoft Power Platform
Microsoft Power Platform
Data Analytics using PowerBI (DA-100)
Testing Tools
Manual Testing
Selenium Testing with Java(Live Training)
Others
Python Programming
C and Data Structure
Core Java
OOPs and C++
Advance Java
Complete Azure Training
Pricing
Videos
Testimonials
Azure Certification
Contact Us
Login
Login or Register
×
Sign In
Register
Forgot Password?
How did you find us
WhatsApp
YouTube
LinkedIn
Facebook
Telegram
Twitter
Google
Referred by Friend
Refresh
Input symbols
By clicking Register, you accept to the
terms and conditions
and that you have read our
privacy policy.
Recover Password
×
Submit
Enquiry Now
Where did you come to know about us
WhatsApp
YouTube
LinkedIn
Facebook
LinkedIn Ad
Email
Twitter
Google
Referred
Other
Refresh
Input symbols
Structures and Unions
Interview Questions and Answer
1. Which of the following does a structure stores?
Options:
a. Multiple values of the same type
b. Multiple values of the different type
c. Multiple values of the same user-defined type
d. None of the above
Reveal Answer
2. Which of the following is the correct syntax for declaring a structure?
Options:
a. struct ( Datatype 1 Datatype 2 };
b. struct tag_name { Datatype 1; Datatype 2; };
c. struct tag_name { Datatype 1 Datatype 2 }
d. struct; { Datatype 1 Datatype 2 }
Reveal Answer
3. Which of the following is the correct way of assigning a value to the ‘name’ field of a structure ‘book’
Options:
a. Book.name
b. Book->name
c. Book(name)
d. None of the above
Reveal Answer
4. The uninitialized integer data type of a structure contains which of the following default values?
Options:
a. Garbage
b. Zero
c. one
d. None of the above
Reveal Answer
5. The uninitialized character data type of a structure contains which of the following default values
Options:
a. Garbage
b. Zero
c. ‘\0’
d. None of above
Reveal Answer
6. The tag name of a structure is optional.
Options:
a. True
b. False
Reveal Answer
7. Structure may contain member of only one data type.
Options:
a. True
b. False
Reveal Answer
8. Structure variable are used to declare data type containing multiple fields.
Options:
a. True
b. False
Reveal Answer
9. A copy of the content of a structure variable to another structure variable of the same type is valid.
Options:
a. True
b. False
Reveal Answer
10. Structure is always passed to function by pointers.
Options:
a. True
b. False
Reveal Answer
11. The '.' operator can be used access structure elements using a structure variable.
Options:
a. True
b. False
Reveal Answer
12. Pointer can be used to access the member of structure variable.
Options:
a. True
b. False
Reveal Answer
13. The keyword typedef is used to define a new data variable.
Options:
a. True
b. False
Reveal Answer
14. A union can have another union as one of the members.
Options:
a. True
b. False
Reveal Answer
15. Union contain member of the different data type.
Options:
a. False
b. True
Reveal Answer
16. A member in a structure can itself be a structure
Options:
a. True
b. False
Reveal Answer
17. The uninitialized character data type of a structure contains which default value?
Options:
a. Garbage
b. Zero
c. ‘/0’
d. None
Reveal Answer
18. What is maximum level C allows for nesting of the structure?
Options:
a. 13
b. 14
c. 15
d. 16
Reveal Answer
19. Which is the valid statement for following declaration of struct abc a, b, c;
Options:
a. scanf(“%d”, &a);
b. printf(“%d”, b);
c. a = b;
d. a =b + c;
Reveal Answer
20. What will be the size of a union variable in following declaration? Union value { int a; float b; char c; }
Options:
a. 1
b. 2
c. 4
d. 8
Reveal Answer
21. Identify the error in the program? struct item { int a; struct item *a; };
Options:
a. Error structure declaration
b. Linker Error
c. No Error
d. None of above
Reveal Answer
22. Identify the error in the program? struct item { int a; struct item a; };
Options:
a. Error in structure declaration
b. Linker Error
c. No Error
d. None of above
Reveal Answer
23. Identify the error in the program? #include<stdio.h> int main() { union a { int a; char ch[2]; }; union a v1 = {123}; union a v2 = {0, 5}; }
Options:
a. Error invalid union declaration
b. Error in initializing v2
c. No error
d. None of above
Reveal Answer
24. How to access chr for n2 structure variable? struct comp { char chr; float b; }; struct num { struct complex c1; int c; }n1, n2
Options:
a. n2.c1.chr
b. n1.c1.chr
c. n2.chr
d. n1.chr
Reveal Answer
25. What will be output of the following code? int main() { struct { int num; float f; char mess[50]; }m; m.num= 1; m.f=3.14; strcpy(m.mess, "Hello"); printf("%d %d %d\n", &m.num, &m.f, m.mess); printf("%d %f %s\n", m.num, m.f, m.mess); }
Options:
a. 93504 93508 93512 1 3.140000 Hello
b. 1 3.140000 Hello
c. 93504 93508 93512
d. 234 453.5674 65774 1 3.140000 Hello
Reveal Answer
26. What will be output of the following code? int main() { static struct item s1 ={"ABC","XYZ"}; printf("%c %c\n",s1.ch[0], *s1.str); printf("%s %s\n",s1.ch, s1.str); } struct item { char ch[7]; char *str; };
Options:
a. A X ABC XYZ
b. ABC XYZ A X
c. X A AA XYZ
d. XYZ X A X
Reveal Answer
Packages
Gold Membership
Microsoft Azure Suite &Suite Plus
Azure DevOps Expert &Expert Plus
MS.NET Foundation For Beginners
MS.NET Full Stack Developer
UI / Web Development
SQL Server & MSBI Tools
Software Testing
Resources
Blog
Deccansoft
AzureA2Z
Wall of Fame
On-Job Tech Support
About
About BestDotNetTraining
About Trainer
Testimonials
FAQ
Other links
About Us
Contact Us
Leave us a feedback
Sitemap
Privacy Policy
Terms & Conditions
Proudly Powered by