
C Programming Day-12

Quiz
•
Engineering
•
University
•
Medium
Vaishnavi K AIDS
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
How do you define a structure with a name student containing an int age?
struct student { int age; };
structure student { int age; };
struct student = { int age; };
student struct { int age; };
Answer explanation
This defines a structure named student with one member age of type int.
It groups related data (here, just age) under one name using the struct keyword.
2.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Predict the output
3 4
4 3
Compilation Error
0 0
Answer explanation
The structure is correctly initialized with x = 3 and y = 4.
3.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
Which keyword is used to define a structure in C?
class
struct
object
define
Answer explanation
In C, struct is the keyword used to create a user-defined data type that groups variables of different types.
4.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the symbol used to declare a pointer?
&
%
*
@
Answer explanation
The asterisk ( * )i s used to declare and dereference a pointer.
5.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What does the & operator do in C?
Adds two numbers
Finds modulus
Multiplies pointers
Finds address of a variable
Answer explanation
&x gives the memory address of x.
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the output of the following code?
Address of x
10
Garbage
Compilation error
Answer explanation
For example, &x gives the memory address of x.
7.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
How do you access the member age of a structure variable p?
p->age
p.age
age.p
p->age()
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Intro-To-Connectivity

Quiz
•
University
10 questions
Strings in python

Quiz
•
University
15 questions
Variables y constantes

Quiz
•
University
10 questions
Alpro 2 Mg 1 - Understanding C++ Basics

Quiz
•
University
10 questions
Introduction to Embedded Systems - Quiz 3

Quiz
•
University
15 questions
Module01_C_M_M&A

Quiz
•
University
10 questions
CNS Lab Viva Questions_B2 Batch

Quiz
•
University
11 questions
Intro To Connectivity

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade