Top

C Constants

Answer: B

No answer description available for this question.
 

Enter details here

52.

What is the output of this C code?

#include 
    enum birds {SPARROW, PEACOCK, PARROT};
    enum animals {TIGER = 8, LION, RABBIT, ZEBRA};
    int main()
    {
        enum birds m = TIGER;
        int k;
        k = m;
        printf("%d\n", k);
        return 0;
    }

 

Answer: D

m is an integer constant, hence compatible.

Output:
$ cc pgm5.c
$ a.out
8

Enter details here

53.

What will be the output of the following C++ code?

#include 
    using namespace std;
    int main()
    {
        int  const  p = 5;
        cout << ++p;
        return 0;
    }

 

Answer: C

We cannot modify a constant integer value.

Enter details here

54.

What is the output of the following 'C' program?
main
{
extern int i;
i = 20;
print("%d",size of (i));
}

Answer: D

No answer description available for this question.
 

Enter details here

Answer: A

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

56.

How to declare a wide character in the string literal?

Answer: A

It can turn this as the wide character instead of narrow characters.

Enter details here

57.

When a variable of data type double is converted into float, then

Answer: A

No answer description available for this question.
 

Enter details here

58.

What is the output of this C code?

#include 
    int main()
    {
        printf("sanfoundry\r\nclass\n");
        return 0;
    }

 

Answer: B

No answer description available for this question.
 

Enter details here

Answer: C

No answer description available for this question.
 

Enter details here

Answer: D

Because these are the types used to declare variables and so these can be declared as constants.

Enter details here

Loading…
Tags: C Constants Questions and Answers || C Constants MCQ Questions and Answers || C Constants GK Questions and Answers || C Constants GK MCQ Questions || C Constants Multiple Choice Questions and Answers || C Constants GK || GK on C Constants || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming