Variables
- What will be the output of the following C code?
#include <stdio.h>
void main()
{
int m = 12;
float m = 12;
printf("%d", m)
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Since the variable m is defined both as integer and as float, it results in an error.
- Which of the following is not a pointer declaration?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: C
Array declarations are pointer declarations.
- 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 illegal?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
char[] s is a declaration 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.