Syntax in C MCQs Exercise II

Ques 1 Syntax


Which of the following is the correct syntax of comment?

A //smallcode
B #smallcode
C !- smallcode -!
D ""Smallcode""

Ques 2 Syntax


Which of the following is the correct syntax of variable declaration?

A int x.
B const int x;
C double x;
D char int x:

Ques 3 Syntax


Which one of the following is the correct syntax for printing "Small Code" ?

A print("Small Code");
B printf("Small Code");
C printf("Small Code"):
D printf(Small Code);

Both print() and printf() are used for printing to the console, but printf() is a C-style function that is not built-in to Python. The print() function is a built-in Python function that is used to print to the console.

Ques 4 Syntax


What is the correct syntax to declare a variable in C?

A var int x;
B x = int;
C int x;
D declare x as int;

Ques 5 Syntax


What is the correct syntax to access a member of a structure in C?

A struct.member
B struct->member
C struct::member
D struct[member]