Multiple choice

Find out the output of the given program or error (if any).

#include<stdio.h>

#include<conio.h>

int main()
{
 unsigned u=65535;
 printf("u=%d",u);
 getch();
}

  1. u=1

  2. u=2

  3. u=65535

  4. error in the program

  5. None of these

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

This is the correct answer. Unsigned integer has a maximum value range 0-65535. So, this is the maximum value. So, u=65535 will be printed. After reaching the last range compiler will start from beginning like for 65636, output will be 1, and for 65537, output will be 2. So, this option is true.