Top

# C Constants

1.

The declaration
enum cities{ bethlehem, jericho, nazareth = 1, jerusalem }
assigns the value 1 to

No answer description available for this question.

Enter details here

2.

Comment on the output of this C code?

int const print()
{
printf("AllIndiaExams.in");
return 0;
}
void main()
{
print();
}

None

Enter details here

3.

Which is false?

Since the constant variable has to be declared and defined at the same time, not doing it results in an error.

Hence the statement a is false.

Enter details here

4.

The C declaration
int b [100];
reserves ____________ successive memory locations,each large enough to contain single integer.

No answer description available for this question.

Enter details here

5.

What is the output of this C code?

#include
int main()
{
enum {ORANGE = 5, MANGO, BANANA = 4, PEACH};
printf("PEACH = %d\n", PEACH);
}

In enum, the value of constant is defined to the recent assignment from left.

Output:
$cc pgm1.c$ a.out
PEACH = 5

Enter details here

6.

int i = 5; is a statement in a C program.

No answer description available for this question.

Enter details here

7.

printf ( "%d" , printf ( "tim" ) ):

No answer description available for this question.

Enter details here

8.

What is the output of this C code?

int main()
{
const int a;
a = 32;
printf("a is %d", a);
return 0;
}

Since the constant variable has to be declared and defined at the same time, not doing it results in an error.

Enter details here

9.

In case of ordinary int variables

No answer description available for this question.

Enter details here

10.

Consider the following statement
#define hypotenuse (a, b) sqrt (a*a + b*b);
The macro-call hypotenuse (a + 2, b + 3);