🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

निम्नलिखित कोड का आउटपुट क्या होगा?

What will be the output of the following code?

int main()
{
int i = 25;
int k =i %4;
printf("%d\n", k);
}

A
1
B
2
C
3
D
4
Explanation

The given code performs a modulo operation (%) on the variable i with 4.

Code explanation:

int i = 25;
int k = i % 4;  // Modulo operation
printf("%d\n", k);  // Prints the result

The modulo operation returns the remainder when i is divided by 4.

  • 25 divided by 4 gives a quotient of 6 with a remainder of 1.

Therefore, i % 4 equals 1.

So, the correct answer is:

(A) 1.

Correct Answer: A) 1

Latest Updates