cast int to char c code example
Example 1: how to print int in c
#include <stdio.h>
int main() {
int number;
printf("Enter an integer: ");
scanf("%d", &number);
printf("You entered: %d", number);
return 0;
}
Example 2: int to char in c
c = i +'0';
Example 3: casting an int to a char in c
Use ASCII chart.
int i=65;
char ch;
ch= (char)i;
printf("Expected value of ch: A. This value is found by using a ASCII chart");