What is the output of this C code?
#define a 20
int main()
{
const int a = 50;
printf("a = %d\n", a);
}
Answer: D
The #define substitutes a with 20 leaving no identifier and hence compilation error.
Complilation Error: expected identifier or ‘(’ before numeric constant
Enter details here
The declarations
typedef float hight [100];
height men, women;
Answer: A
No answer description available for this question.
Enter details here
Comment on the output of this C code?
#include
void main()
{
int const k = 5;
k++;
printf("k is %d", k);
}
Answer: D
Constant variable has to be declared and defined at the same time. Trying to change it results in an error.
Output:
$ cc pgm12.c
pgm12.c: In function ‘main’:
pgm12.c:5: error: increment of read-only variable ‘k’
Enter details here
The declaration
int x : 4;
means
Answer: C
No answer description available for this question.
Enter details here
Which of the following are true regardless of the implementation ?
Answer: D
No answer description available for this question.
Enter details here
The rule for implicit type conversion in 'C' is
Answer: A
No answer description available for this question.
Enter details here
Which of the following 'C' type is not a primitive data structure?
Answer: D
No answer description available for this question.
Enter details here
Printing a character as an integer
Answer: C
No answer description available for this question.
Enter details here
The value of an automatic variable that is declared but not initialized will be
Answer: C
No answer description available for this question.
Enter details here
A static variable
Answer: C
No answer description available for this question.
Enter details here