Quick links: C-Tricks HR Interview Que. Code Snippets C Programs C++ Programs Java Programs PHP Examples

Home » Code Snippets » C/C++ Code Snippets

‘unsigned char’ declaration, read and print in c language

By: IncludeHelp On 20 DEC 2016

unsigned char is a character data type with larger range of the value than signed char.

Whenever we work with positive value between the range of 0 to 255, we can use unsigned char instead of short, int type of data type.

Declaration

unsigned char variable_name;
unsigned char age;

Sponsored Links



Consider the program to read and print the unsigned char value in C

#include <stdio.h>

int main()
{
	unsigned char age;
	
	printf("Enter age: ");
	scanf("%d",&age);
	
	printf("Input age is: %d\n",age);
	
	return 0;
}

Output

Enter age: 75 
Input age is: 75 

COMMENTS

Solved programs


Sponsored Links


Most viewed pages


Featured posts
C Tips and Tricks