ALL > Computer and Education > courses > university courses > undergraduate courses > An Overview of Computer Science > zstu-(2019-2020-1) class >
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

Please login to reply. Login

Reversion History

Loading...
No reversions found.