Font size
WorksheetsC
Total questions: 20
Worksheet time: 12mins
Which of the function cannot be a structure member?
Another structure
Function
Array
None
Which of the following are themselves a collection of different data types?
String
Struct
char
all
Which operator connects the structure name to its member name?
-
=
.
>>
What is the output of this C code?
void main()
{
struct student
{
int no;
char name[20];
};
struct student s;
s.no = 8;
printf("%d", s.no);
}
Nothing
Compile error
8
Junk
Size of a union is determined by size of the.
First member in the union
Last member in the union
C. Biggest member in the union
Sum of the sizes of all members
Memory allocated for structure members are always contigious
True
False
Union is a keyword of C
In a C Program if
int a = 5;
Int *ptr = &a;
then the printf statement with
&a, a, *ptr , ptr
adrress, Value, Value, Adress
address, value, value, value
all address
All values
Code to change the 3rd array value to 50 using pointers
int main(){
int a[] = {10,20,30};
int *p = a;
----------------------;
}
p+3 = 50
*(p+3) = 50
*p+2 = 50
*(p+2) = 50
The format identifier ‘%i’ is also used for _____ data type.
char
int
float
double
What is the default return type if it is not specified in function definition?
void
int
double
short int
Which type of variables can have the same name in a different function?
Global variables
Static variables
Function arguments
Both static variables and Function arguments
Who is know as founder of C language
Dennis Ritchie
Bjarne Stroustroup
Tim Berner Lee
Rasmus Ledorf
Which of these is not a correct variable data type?
int
float
real
char
C is a
Low level language
Assembly language
Medium level language
High level language
The starting point of C execution at
==
main()
function()
!=
Why do you need to import stdio.h a header file?
Just a waste of time
To run the code
It helps in compilation to binary coded file
To perform input and output operations
What are malloc() and calloc()
Dynamic memory allocation
static memory allocation
run time memory allocation
none of these
which of the following is a correct identifier in C++ ?
VAR_1234
$var_name
7VARNAME
7var_name
Which of the following approach is used in C++ ?
left - right
right - left
bottom - top
top - bottom
