Top

Declarations and Initializations

1.

What is the output of this C code?

void main()
{
int k = 4;
float k = 4;
printf("%d", k)
}

Answer: A

No answer description available for this question.

Enter details here

2.

Does this compile without error?

int main()
{
int k;
{
int k;
for (k = 0; k < 10> }
}

Answer: A

No answer description available for this question.

Enter details here

Answer: D

char[ ] str is a declaration in Java, not in C.

Enter details here

Answer: B

External Linkage-> means global, non-static variables and functions.
Internal Linkage-> means static variables and functions with file scope.
None Linkage-> means Local variables.

Enter details here

5.

How would you round off a value from 1.66 to 2.0?

Answer: A

No answer description available for this question.

Enter details here

6.

Global variable are available to all functions. Does there exist a mechanism by way of which it available to some and not to others.

Answer: B

The only way this can be achieved is to define the variable locally in main() instead of defining it globally and then passing it to the functions which need it.

Enter details here

7.

Which of the following format identifier can never be used for the variable var?

int main()
{
char *var = "Advanced Training in C by AllIndiaExams.com";
}

Answer: A

?an be used to print the indexed position. ?an still be used to display its ASCII value. %s is recommended.
?annot be used.

Enter details here

8.

Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ?

Answer: C

No answer description available for this question.

Enter details here

9.

Is it true that a function may have several declarations, but only one definition?

Answer: A

No answer description available for this question.

Enter details here

10.

Which of the following is not a pointer declaration?

Answer: D

No answer description available for this question.

Enter details here

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