Write a program that prompts the user to enter an integer andthen prints the int
ID: 3609461 • Letter: W
Question
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.0000Explanation / 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; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.