adplus-dvertising

Welcome to the Programming in C MCQs Page

Dive deep into the fascinating world of Programming in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Programming in C, a crucial aspect of UGC CBSE NET Exam. In this section, you will encounter a diverse range of MCQs that cover various aspects of Programming in C, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within UGC CBSE NET Exam.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Programming in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of UGC CBSE NET Exam.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Programming in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Programming in C MCQs | Page 6 of 16

Q51.
When we pass an array as an argument to a function, what actually gets passed ?
Discuss
Answer: (c).Base address of the array
Discuss
Answer: (d).print "computer" infinite times
Discuss
Answer: (c).allow one class to access an unrelated class
Q54.
What is the size of the following Union ? Assume that the size of int = 2, size of float = 4, size of char = 1

union tag {
int a;
float b;
char c;
};

a.

2

b.

4

c.

1

d.

7

Discuss
Answer: (b).4
Q55.
What is the output of the following program segment?

sum(n)
{
if ( n < 1 ) return n;
else return (n + sum(n–1));
}
main()
{
printf(“%d”, sum(5));
}
Discuss
Answer: (c).15
Q56.
Assume that x and y are non-zero positive integers. What does the following program segment perform?

while (x!=0)
{
if (x>y)
x = x-y
else
y=y-x;
printf(“%d”,x);
Discuss
Answer: (b).Computes GCD of two numbers
Q57.
Consider the following program segment:

d=0;
for(i=1; i<31, ++i)
for(j=1; j<31, ++j)
for(k=1; k<31, ++k)
if ((i+j+k)%3)= = 0);
d = d + 1;
printf(“%d”, d);

The output will be
Discuss
Answer: (d).None of the above
Discuss
Answer: (d).The first declaration is a function returning a pointer to an integer and the second is a pointer to function returning integer.
Q59.
Assume that we have constructor function for both Base and Derived classes. Now consider the declaration :

main ( )
Base *p = new Derived;

In what sequence, the constructor will be executed ?
Discuss
Answer: (b).Base class constructor is followed by Derived class constructor
Q60.
What is the output of the following program ?
#include< stdio.h >
main( )
{
int a, b = 0;
static int c[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
for (a=0; a<10;++a);
if ((c[a]%2)= =0) b+=c[a];
printf(“%d”,b);
}
Discuss
Answer: (d).20
Page 6 of 16

Suggested Topics

Are you eager to expand your knowledge beyond Programming in C? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!