Use scanf to read Unsigned Integers - C Language Basics

C examples for Language Basics:scanf

Introduction

To input an unsigned integer, use the %u format specifier. For example,

Demo Code

#include <stdio.h>

int main(void)
{
   unsigned num;//from ww  w .  j a v  a2 s  .  com
   scanf("%u", &num);

   printf("%u", num);

   return 0;
}

Result


Related Tutorials