homework2_ 2019529628044 PATIENCE FERO Version 0 |
|
👤 Author: by patiencefero7gmailcom 2019-10-27 06:46:14 |
// My own program in Appendix C
#include <stdio.h>
int main()
{
// Declare the variables
int num;
char ch;
float f;
// Input the integer
printf("Enter the integer: ");
scanf("%d", &num);
// Output the integer
printf("\nEntered integer is: %d", num);
// Input the float
printf("\n\nEnter the float: ");
scanf("%f", &f);
// Output the float
printf("\nEntered float is: %f", f);
// Input the Character
printf("\n\nEnter the Character: ");
scanf("%c", &ch);
// Output the Character
printf("\nEntered integer is: %c", ch);
return 0;
}
Output:
Enter the integer: 10
Entered integer is: 10
Enter the float: 2.5
Entered float is: 2.500000
Enter the Character: A
Entered integer is: A