C Programming MCQs with answers Page - 20

Here, you will find a collection of MCQ questions on C Programming. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. Choose a right statement.

  • (A) Variables of type auto are initialized fresh for each block or function call.
  • (B) Variables of type static are initialized only first time the block or function is called.
  • (C) Variables of type register are initialized each time the block or function is executed.
  • (D) All of the above

A

Admin • 833.24K Points
Coach

Q. What is the output of the program.?
#include<stdio.h>

Code:
int main()
{
	printf("Hello Boss.");
}
  • (A) Hello Boss.
  • (B) hello boss
  • (C) No output
  • (D) Compiler error

A

Admin • 833.24K Points
Coach

Q. What is the output of the program?

Code:
int main()
{
	auto int a=10;
	{
		auto int a = 15;
		printf("%d ", a);
	}
	printf("%d ", a);
	return 1;
}
  • (A) 10 10
  • (B) 10 15
  • (C) 15 10
  • (D) Compiler error

A

Admin • 833.24K Points
Coach

Q. What is the output of the program?

Code:
int main()
{
	register a=10;
	{
		register a = 15;
		printf("%d ", a);
	}
	printf("%d ", a);
	
	return 20;
}
  • (A) 15 20
  • (B) 15 10
  • (C) 10 15
  • (D) 15 15

A

Admin • 833.24K Points
Coach

Q. What is the output of the C Program statement?

Code:
register int b;
prinf("%d", b);
  • (A) null
  • (B) 0
  • (C) random integer number
  • (D) random real number

A

Admin • 833.24K Points
Coach

Q. What is the output the program?

Code:
int main()
{
	register a=80;
	auto int b;
	b=a;
	printf("%d ", a);
	printf("%d ", b);
	
	return -1;
}
  • (A) Compiler error. You can not assign register value to int variable.
  • (B) 80 80
  • (C) 80 0. Register value can not be copied.
  • (D) Compiles, but output is none.

A

Admin • 833.24K Points
Coach

Q. What is the output of the program.?

Code:
void myshow();

int main()
{
	myshow();
	myshow();
	myshow();
}

void myshow()
{
	static int k = 20;
	printf("%d ", k);
	k++;
}
  • (A) 20 20 20
  • (B) 20 21 21
  • (C) 20 21 22
  • (D) Compiler error.

A

Admin • 833.24K Points
Coach

Q. What is the output of the program.?
#include<stdio.h>

Code:
static int k;

int main()
{
	printf("%d", k);
	
	return 90;
}
  • (A) -1
  • (B) 0
  • (C) 90
  • (D) Compiler error

A

Admin • 833.24K Points
Coach

Q. Operator % in C Language is called.?

  • (A) Percentage Operator
  • (B) Quotient Operator
  • (C) Modulus
  • (D) Division

A

Admin • 833.24K Points
Coach

Q. Output of an arithmetic expression with integers and real numbers is ___ by default.?

  • (A) Integer
  • (B) Real number
  • (C) Depends on the numbers used in the expression.
  • (D) None of the above