Write a program that prompts the user to enter an integer andthen prints the integer first as a character, then as a decimal,and finally as a float. Use separate print statements. A sample runis shown below. The number as a character :K The number as adecimal : 75 The number as afloat : 0.0000 Write a program that prompts the user to enter an integer andthen prints the integer first as a character, then as a decimal,and finally as a float. Use separate print statements. A sample runis shown below. The number as a character :K The number as adecimal : 75 The number as afloat : 0.0000
Explanation / Answer
please rate - thanks #include #include int main() {int k; printf("Enter a number: "); scanf("%d",&k); printf("The number as a character: %c ",k); printf("The number as a decimal: %d ",k); printf("The number as a float: %f ",k); getch(); return 0; }