ProAnswers.org

Write a C program to read and print the integer value using character variable?

#include

#include 

void main() 

{ 

Char a; 

clrscr(); 

printf(“Enter value of „A‟:”); 

scanf(“%d”, &a); 

printf(“A=%d”, a); 

getch(); 

} 

Output: 

Enter value of „A‟: 255 

A=255 

Enter value of „A‟: 256 

A=0