Quick links: HR Interview Que. Code Snippets C Programs C++ Programs Java Programs Scala Solved Examples 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

Keywords (like Linux, Java, Oracle etc) used in this website are the trademarks of their respective owners/company. This website is not affiliated to any company. The tutorials are designed by includehelp Team with the help of well known books and other online resources. These Tutorials are free for all, for learning purposes only. Enjoy learning:)
Copyright © 2015 - 2016. All Rights Reserved.