Typedef MCQ Questions & Answers
This section focuses on the "typedef" in C programming. These Multiple Choice Questions (MCQ) should be practiced to improve the C programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. The C programming language provides a keyword called _________, which you can use to give a type a new name.
View Answer
2. can we use typedef to give a name to your user defined data types as well?
View Answer
3. ___________ is a C-directive which is also used to define the aliases for various data types.
View Answer
4. __________ statements are processed by the pre-processor.
View Answer
5. What will be output for the following code?
#include <stdio.h>
#define TRUE 1
int main( ) {
printf( ""Value of TRUE : %d
"", TRUE);
return 0;
}
View Answer
6. Which option should be selected to work the following C expression?
string p = "HELLO";
View Answer
7. typedef int (*PFI)(char *, char *)creates ___________
View Answer
8. What will be the output of the following C code?
#include <stdio.h>
typedef struct student
{
char *a;
}stu;
void main()
{
struct stu s;
s.a = ""hi"";
printf(""%s"", s.a);
}
View Answer
9. What will be the output of the following C code?
#include <stdio.h>
typedef struct student
{
char *a;
}stu;
void main()
{
struct student s;
s.a = ""hey"";
printf(""%s"", s.a);
}
View Answer
10. #define can be used to define alias for values as well
View Answer
Discussion