Variables
- Which keyword is used to prevent any changes in the variable within a C program?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
const is a keyword constant in C program.
- Which of the following declaration is not supported by C?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
It is legal in Java, but not in C.
- Which of the following format identifier can never be used for the variable var?
#include <stdio.h>
int main()
{
char *variable = "Advanced Training in C by interviewmania.com";
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: D
%c can be used to print the indexed position.
%d can still be used to display its ASCII value.
%s is recommended.
%f cannot be used for the variable var.
- Which of the following declaration is illegal?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
char[] s is a declaration in Java, but not in C.
- Will the following C code compile without any error?
#include <stdio.h>
int main()
{
int n;
{
int n;
for (n = 0; n < 12; n++);
}
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
There can be blocks inside the block. But within a block, variables have only block scope.