write a program that promps the user to enter an integer andthen prints the inte
ID: 3616736 • Letter: W
Question
write a program that promps the user to enter an integer andthen prints the integer first as a character, then as a decimal,and finally as float. Use separate print statements. A sample runis shown below. the number as a character: K the number as a decimal: 75 the number as a float: 0.000000 write a program that promps the user to enter an integer andthen prints the integer first as a character, then as a decimal,and finally as float. Use separate print statements. A sample runis shown below. the number as a character: K the number as a decimal: 75 the number as a float: 0.000000Explanation / Answer
please rate - thanks #include #include int main() {int n; printf("enter a number: "); scanf("%d",&n); printf("the number as a character: %c ",(char)n); printf("the number as decimal: %d ",n); printf("the number as float: %f ",(float)n); getch(); return 0; }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.