Examveda
Examveda

What is the result of the expression 8 % 4 in C?

A. 0

B. 4

C. 2

D. 8

Answer: Option A

Solution(By Examveda Team)

In C, the % (modulo) operator is used to calculate the remainder when one number is divided by another. In the expression 8 % 4, it calculates the remainder of dividing 8 by 4, which is 0.

Option B (4) is incorrect because it doesn't represent the remainder of the division.
Option C (2) is incorrect because it also doesn't represent the remainder; it represents half of the dividend.
Option D (8) is incorrect because it's the dividend itself, not the remainder of the division.

This Question Belongs to C Program >> Operators And Expressions

Join The Discussion

Related Questions on Operators and Expressions