Multiple choice

#include<stdio.h> #include<coni.h> int main() { unsigned long v=-1; printf(v=%lu,v); getch(); }

Find the output of the above program or error, if any.

  1. v=-1

  2. v=4294967295

  3. v=4294967296

  4. v=0

  5. error in the program

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

Unsigned data types don’t have negative values. They have range from 0 to 4294967295. So, if negative value is given to any variable, it will count from its last value,  which is 4294967295. So, this is the correct answer. If we give v = -2, the result will be 4294967294. So, it will keep decrementing values.