Variables
- What will be the output of the following C code?
#include <stdio.h>
int main()
{
printf("Hello Interview Mania! %d \n", num);
return 0;
}
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
It results in an error since num is used without declaring the variable num.
- Which of the following is not a valid C variable name?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
Since only underscore and no other special character is allowed in a variable name, it results in an error.
- Which of the following is true for variable names in C?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
According to the syntax for C variable name, it cannot start with a digit.
- Which is valid C expression?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: B
Space, comma and $ cannot be used in a variable name.
- Which of the following is not a valid variable name declaration?
-
View Hint View Answer Discuss in Forum
NA
Correct Option: A
#define PI 3.14 is a macro preprocessor, it is a textual substitution.